Howdy all,
Roll on the weekend.
I have a small prg which should tell me the maximum lengths of all the
fields in a table.
Here's the code:
LPARAMETERS tcFileName
USE &tcFileName
lnFields = AFIELDS( laFields)
FOR lnLoop = 1 TO lnFields
lnMax = 0
lcField = ALLTRIM( laFields( lnLoop, 1))
SET TALK OFF
CALCULATE MAX( LEN( RTRIM( EVALUATE( lcField)))) TO lnMax
SET TALK ON
? lcField + IIF( LEN( lcField) < 8, CHR( 9) + CHR( 9), CHR( 9)) +
TRANSFORM( laFields( lnLoop, 3)) + [ should be ]
?? TRANSFORM( lnMax)
ENDFOR
My problem is that Evaluate() is evaluating the fieldname not the
contents of the fieldname. Replacing Evaluate( lcField) with &lcField
does not help either.
Any other ideas?
Cheers,
Garry
--
MCP, Security+, MCTS SQL 2005
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.