Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
$ Command - Syntax question
Message
From
06/04/1998 11:34:38
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00089827
Message ID:
00089842
Views:
23
>
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform