Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: index on can fail with a varchar field
Message
From
23/10/2005 10:26:09
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Title:
BUG: index on can fail with a varchar field
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01061478
Message ID:
01061478
Views:
44
repro:
=AFONT(aFontList)
DIMENSION aFontList[ALEN(aFontList),1]
CREATE CURSOR fontInfo (FontName V(65))
APPEND FROM ARRAY aFontList

CLEAR
? 'I can calculate MAX(TXTWIDTH("",FontName,8)) ='

CALCULATE MAX(TXTWIDTH("",FontName,8)) TO maxLength
?? maxLength
LOCATE
? " COMPUTE THE INDEX FAIL !!!  "
TRY 
	INDEX ON TXTWIDTH("",FontName,8) TAG lenindex
CATCH
	?? MESSAGE()
ENDTRY

?
? "EXPLAIN:"
? "During the phase of analysis"
? "VFP uses the raw value stored in the dbf !"
? "Look the last byte = 17, it is the length of the string"


LOCATE
INDEX ON TXTWIDTH("",CHECK(FONTNAME),8) TAG lenindex

FUNCTION CHECK(FF)
	IF NOT M.FF==FONTNAME
		? "NOT EQUAL ! THE VALUE IS =",0H+M.FF
	ENDIF
	RETURN FONTNAME
Reply
Map
View

Click here to load this message in the networking platform