Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
This script is not working......
Config:
LOAD
ScriptConfig
FROM Configurations.xls
(biff, embedded labels, table is ObjectConfig$);
let VRow = NoOfRows('Config');
let VInclude = FieldValue('ScriptConfig',$(VRow));
if $(VInclude) then
$(Include= File1.qvs)
ELSE
$(Include= File2.qvs)
EXIT Script;
end if
Could you post a sample Configuration.xls?
did you try to run it with the 'exit script;' at the very end (so after 'end if')?
that file is having YES value..
Means if I pass Yes value in the ScriptConfig Column then first Qvs should work other wise Else part should execute.
Think about it: a table may contain 1000s of identical rows, but a field from that table will contain only one value: the one distinct value that appears in every row...
Your index of the last row is probably out of bounds by a large margin for field ScriptConfig. Does the Configurations.xls file contain empty values in column ScriptConfig?
Best,
Peter
Hey Daniel Yes i have tried in that way Still not working ....?
Hey Peter That Excel file is having One Column and One Row....
I tried this and it works (all files inthe same dir)
DIRECTORY;
Config:
LOAD ScriptConfig
FROM
Configurations.xls
(biff, embedded labels, table is ObjectConfig$);
let VRow = NoOfRows('Config');
let VInclude = FieldValue('ScriptConfig',$(VRow));
trace $(VInclude);
if len(trim('$(VInclude)'))>0 then
trace include file1;
$(Include=File1.qvs);
ELSE
trace include file2;
$(Include=File2.qvs);
EXIT Script;
end if;
So you will encounter this problem as soon as you have two rows with a YES-value.
BTW the code in the middle:
if $(VInclude) then
:
with your data translates into
if YES then
:
which doesn't do much (except if you store -1 in variable YES), or into
if then
:
which is an illegal statement.
I think Massimo's IF statement will work more reliably.
Peter
Hey hi Massimo,
The above script is worked for my First If statement but ELSE part is not working in the situation.
and one more question are you passing Text value in that column or Numeric one..?