Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
$ Command - Syntax question
Message
De
06/04/1998 11:34:38
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00089827
Message ID:
00089842
Vues:
24
>
>IF cursor.ins_type $ "COMP:MB :MCS :BC "
>
>My question -
>
>What significance do the colons have in this. I can't find any help on the syntax for the character string. Can the character string just be continuous and yield the same result? (i.e. "COMPMB MCS BC"
>
The colons are simply a separator to ensure that blanks will not cause invalid matches. Look at the following statements and assume you want to find "PH D".

IF you used this statement:

IF cursor.ins_type $ "MS APH DDS"

This returns TRUE because "PH D" is within the string even though not the intent. But if we colon-separate valid values:

IF cursor.ins_type $ "MS:APH:DDS"

Only the intended substring within the string can match and "PH D" will no longer erroneously match.

HTH
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform