Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange problem with RAT
Message
From
10/11/2006 13:25:19
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01168771
Message ID:
01168808
Views:
15
This message has been marked as a message which has helped to the initial question of the thread.
This is not directly related to the problem you are asking, but in the CHRTRAN() statement replace the SPACE(26) with a SPACE(27) to better handle the '-'.

>Hi everybody,
>
>I have the following code
>
>lcCheck = ALLTRIM(CHRTRAN(m.lcStyle, "ABCDEFGHIJKLMNOPQRSTUVWXYZ-", SPACE(26))) && Remove letters from the string
>lnPos = AT(" ", m.lcCheck) && Do we have 1 or 2 numbers?
>IF m.lnPos > 0
>	lcNumberPart = LEFT(m.lcCheck, m.lnPos - 1)
>	lcQuality = SUBSTR(m.lcCheck, m.lnPos + 1) && Assuming we can only have 2 numbers in the style
>	lnPos = RAT(m.lcQuality, m.lcStyle)
>	IF m.lnPos > 0
>		lcCheck = SUBSTR(m.lcStyle, 1, m.lnPos - 1) && We're removing quality part
>	ELSE
>		lcCheck = m.lcStyle
>	ENDIF
>			
>	llStone = .T. && We do have a stone info if we have quality
>ELSE
>	lcNumberPart = m.lcCheck
>	lcQuality = ""
>	lcCheck = m.lcStyle && What if we have a stone but no quality, say, E94s or even without stone W-E94
>	llStone = ISALPHA(RIGHT(m.lcStyle,1))
>ENDIF
>
>
>
>which I'm testing for lcStyle = upper([w-4164bt5])
>
>For some reason lnPos = RAT(m.lcQuality, m.lcStyle) returns 0. I can not understand, what's wrong.
Greg Reichert
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform