Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Set vListOfTables = ;
For vTableNo = 0 to NoOfTables() // iterate throw tables
Let vTableName = TableName($(vTableNo)) ; //get the name of the table.
let VNo.ofFields = NoOfFields(vTableName);//get the number of fields.
for i=0 to $(VNo.ofFields)-1 //iterate throw fields.
let VFieldName=FieldName(i,vTableName); // get the name of the field. (Here i got NULL value)
Can any one help me please.
jvs
Maybe try as follow:
for i=1 to $(VNo.ofFields) //iterate throw fields.
let VFieldName=FieldName($(i),'$(vTableName)');
result:
while with
for i=0 to $(VNo.ofFields)-1 //iterate throw fields.
let VFieldName=FieldName($(i),'$(vTableName)');
you'll get Null: (and that's normal)
Have u tried to surround the table by quotes:
let VFieldName=FieldName(i,'$(vTableName)');
Still Null !?
How about this
let VFieldName=FieldName($(i),'$(vTableName)');
Still NULL !?
Everything above it has the correct values? Did you add TRACE to check if the TableName is coming in correctly or not? Also, you are not changing the variable number so VFieldName will only have the last value from the last table... is that what you want?
Yes Mr. Sunny i am tracing
The table name is correct and i know that just the last value is stored in the variable because firstly i want to be sure that the functions is working after that i will add required statements but still i do not know why i get NULL Value instead of field name.
Can't see why it doesn't work.... may be someone else might be able to help
Maybe try as follow:
for i=1 to $(VNo.ofFields) //iterate throw fields.
let VFieldName=FieldName($(i),'$(vTableName)');
result:
while with
for i=0 to $(VNo.ofFields)-1 //iterate throw fields.
let VFieldName=FieldName($(i),'$(vTableName)');
you'll get Null: (and that's normal)
It is solved.
The correct answer is :
The first index is 1 not 0 and come to know after trying this code and it is working :
for i=1 to $(VNo.ofFields)
let VFieldName=FieldName($(i),'$(vTableName)');
Next i
Thank you all.