Incompatible types: 'Char' and 'String'

Résolu
CharlEm80 Messages postés 66 Date d'inscription vendredi 1 septembre 2006 Statut Membre Dernière intervention 1 août 2012 - 22 mai 2012 à 10:53
CharlEm80 Messages postés 66 Date d'inscription vendredi 1 septembre 2006 Statut Membre Dernière intervention 1 août 2012 - 22 mai 2012 à 13:51
Bonjour,

Voilà encore une bonne colle.

Je fais tout simplement ceci
var PatientEvents: String;
PatientEvents := UpCase(table2.FieldByName('Patient').AsString);

je reçois [Error]: Incompatible types: 'Char' and 'String' pourtant je mets bien .AsString mais rien n'y fait.

Si je change par ceci
var PatientEvents: String;
PatientEvents := UpCase(table2.FieldByName('Patient'));

je reçois [Error]: Incompatible types: 'Char' and 'TField'

Si je change par ceci
var PatientEvents: Char;
PatientEvents := PChar(UpCase(table2.FieldByName('Patient').AsString));

je reçois [Error]: Incompatible types: 'Char' and 'String'

Comment s'en sortir?

Merci

3 réponses

fbalien Messages postés 251 Date d'inscription dimanche 7 décembre 2003 Statut Membre Dernière intervention 11 novembre 2016
22 mai 2012 à 12:27
Bonjour

regardez du coté de UpCase

A+
3
cs_cantador Messages postés 4720 Date d'inscription dimanche 26 février 2006 Statut Modérateur Dernière intervention 31 juillet 2021 13
22 mai 2012 à 12:43
Bonjour,

Comment le champ 'Patient' est-il déclaré dans la table ?
Par ailleurs upcase concerne un seul caratère et donc dans ce cas, la procédure n'est pas adapatée..

peut-être une confusion avec uppercase ?

cantador
3
CharlEm80 Messages postés 66 Date d'inscription vendredi 1 septembre 2006 Statut Membre Dernière intervention 1 août 2012 1
22 mai 2012 à 13:51
Je vous aime les mecs
0
Rejoignez-nous