Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get the Table Caption name
Message
From
10/05/2002 12:02:30
 
 
To
25/01/2002 05:19:52
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00610175
Message ID:
00655115
Views:
23
Hello Daniel,

I find this code very helpful. Thanks! Now, I wonder, how may I get the captions for the Local Views? Not all of the AFIELDS contents are passed over from the actual tables to Views. How may I code the class to look at the actual tables of the Views to retrieve the information? Is there a way? TIA!

>João,
>You could do something like this:
>
>DECLARE laFieldsX[1]
>?aFieldsX(@laFieldsX)
>
>FUNCTION aFieldsX
>*-- same as AFIELDS() but adds another column to the array which
>*-- contains the field caption.
>LPARAMETERS taArray
>
>LOCAL lnFields, lnCols, lcDbc, lcLongTableName, lcFieldName, lcCaption
>
>IF EMPTY(ALIAS())
>   RETURN 0
>ENDIF
>
>lnFields = AFIELDS(laFields)
>lnCols   = ALEN(laFields, 2) + 1
>DIMENSION taArray[lnFields, lnCols]
>
>lcDbc = CURSORGETPROP("DATABASE")
>
>lcLongTableName = laFields[1, 12]
>
>FOR lnField = 1 TO lnFields
>
>   FOR lnCol = 1 TO lnCols-1
>      taArray[lnField, lnCol] = laFields[lnField, lnCol]
>   ENDFOR
>
>   IF NOT EMPTY(lcDbc)
>      *-- add caption to array
>      lcFieldName = lcLongTableName + "." + laFields[lnField, 1]
>      lcCaption = DBGETPROP(lcFieldName, "FIELD", "CAPTION")
>   ELSE
>      lcCaption = ""
>   ENDIF
>   taArray[lnField, lnCols] = lcCaption
>
>ENDFOR
>
>RETURN lnFields
>
>
>>Hi Garrett,
>>
>>I think is that what i'm looking for, but if you have some article about that?
>>
>>Other way i can code that!
>>
>>Thank's for your help.
>>
>>João Batista
Thanks!
~d
J
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform