Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get the Table Caption name
Message
From
25/01/2002 05:19:52
 
 
To
24/01/2002 17:56:36
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00610175
Message ID:
00610342
Views:
20
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
Daniel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform