Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetWordNum()
Message
 
 
To
14/03/2007 13:54:41
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01203560
Message ID:
01203569
Views:
14
>I came across this code
>REPLACE ALL RefPartNo WITH IIF('@' $ RefPartNo, SUBSTR(RefPartNo,1,AT('@',RefPartNo)-1), RefPartNo)  IN 'zUniqs'
>REPLACE ALL RefPartNo WITH IIF('+' $ RefPartNo, SUBSTR(RefPartNo,1,AT('+',RefPartNo)-1), RefPartNo)  IN 'zUniqs'
>
>and am wondering if
>REPLACE ALL RefPartNo WITH GETWORDNUM(RefPartNo,'@+') IN 'zUniqs'
>really is the equivalent expression I think it is. I wasn't able to find a difference, but I may not have tested all conditions and am looking for reassurance.
>
>Thanks.......Rich

Looks like you missed (typo?) 1 as the second parameter.

But they are not entirely equavalent.
refpartno = "@*"
=MESSAGEBOX(SUBSTR(RefPartNo,1,AT('@',RefPartNo)-1))
=MESSAGEBOX(GETWORDNUM(RefPartNO,1,'@+'))
In other words, when the RefPartNo starts with @ you would not get the same result.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform