Amferreira
Programmer
How can check (programmatically) if a field exist on a view ?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
SET COMPATIBLE OFF
IF FSIZE('mycolumn','myalias') > 0
if !EMPTY(FIELD('mycolumn','myalias'))
.HackFox said:FSIZE() is a horror show ... it's one of the few [functions] that is affected by the dreaded SET COMPATIBLE command ... Our advice: leave COMPATIBLE SMART (FoxPlus) and use ADIR() to get file sizes
... would be simpler than searching an array.
LOCAL ARRAY laStructure[1]
use lvMyView
= AFIELDS(laStructure, "lvMyView")
IF ASCAN(laStructure, "MyFieldName", 1, -1, 1, 1) > 0
[indent]MyFieldName exists[/indent]
ELSE
[indent]MyFieldName does not exist[/indent]
ENDIF
CLOSE ALL