Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DrawText format problems
Message
From
23/03/2005 10:09:19
 
 
To
22/03/2005 17:11:32
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00998177
Message ID:
00998414
Views:
20
Hello,

you cannot use the constants at runtime since they only have a meaning at compilation time.

I would use one of these approaches:

1. store the parameter value in numerical form (field type int) directly into the table (saves table space and performance is the best you can get)
the only disadvantage is that you have to manually do some math to fill the table

2. store the parameter value in a 3 byte long character field with abbreviations for the possible alignment settings
e.g. C = Center, R = right, B = break, (Left is default)
CR = center+break
then write a simple udf

FUNCTION EncodeTextAlignment(lcAlign)
LOCAL lnAlign
lnAlign = 0
IF "C" $ lcAlign
lnAlign = TEXT_CENTER
ENDIF
IF "R" $ lcAlign
lnAlign = lnAlign + TEXT_RIGHT
ENDIF
IF "B" $ lcAlign
lnAlign = lnAlign + TEXT_BREAK
ENDIF
RETURN lnAlign
ENDFUNC

and call your UDF instead of EVAL, VAL ..


Regards
Christian
Previous
Reply
Map
View

Click here to load this message in the networking platform