Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code is not functioning
Message
De
08/05/2006 17:47:51
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
08/05/2006 14:38:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Divers
Thread ID:
01120099
Message ID:
01120193
Vues:
13
>>>Why the code is not functioning?
>>>
>>>
>>>IF THISFORM.COMBO1.VALUE=ALLTRIM("RAM") OR ALLTRIM("RAHIM")
>>>INSERT INTO TESTC(NAME);
>>>VALUES(THISFORM.COMBO1.VALUE)
>>>ENDIF
>>>
>>>IF THISFORM.COMBO1.VALUE=ALLTRIM("SHYAM") OR ALLTRIM("JOHN")
>>>INSERT INTO TESTC(NAME);
>>>VALUES(THISFORM.COMBO1.VALUE)
>>>ENDIF
>>>
>>>
>>
>>If works with boolean values. ALLTRIM("RAHIM") return value is character.
>>If
>>THISFORM.COMBO1.VALUE=ALLTRIM("RAM")
>>is not true, or would cause second expression to be evaluated and would fail.
>>Probably you meant:
>>
>>if inlist(alltrim(THISFORM.COMBO1.Value),"RAM,RAHIM,SHYAM,JOHN")
>>  INSERT INTO TESTC (NAME) VALUES(THISFORM.COMBO1.Value)
>>ENDIF
>>
Cetin
>
>
>Don't forget the standard warning about SET EXACT. With SET EXACT OFF values like "RAMA","JOHNNY" become "RAM" and "JOHN" for comparison purposes and could return an incorrect TRUE. That may be OK in the application, but then again................

Rich,
Alltrim(THISFORM.COMBO1.Value) was used to force exactness. RAMA,JOHNNY are not on list.
PS: Inlist was buggy however as Hugo pointed out.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform