Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange problem with RAT
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Strange problem with RAT
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01168771
Message ID:
01168771
Views:
67
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.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform