Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Finally I did it,
In this example variables are loaded from an inline table, but from a qvd this is the same:
tables_variables:
LOAD * INLINE [
Variable_name, Variable_value
asterix, smart
obelix, big
idefix, fast
];
for i=0 to noofrows('tables_variables')-1
LET var_name= peek('Variable_name',i,'tables_variables');
LET $(var_name) = peek('Variable_value',i,'tables_variables');
next i
Just reload and ... Tada ...
Why not?
Should be a script like the below (not tested):
LET sMyVariable = 'TEST';
VarTable: LOAD $(sMyVariable) AS TableField AUTOGENERATE 1;
STORE VarTable INTO .\VarTable.qvd;
HTH
Peter
And when you want to read that information you can use either
peek(TableField,0)
or
FieldValue(TableField,1)
Those should return the field value so you can use it.
And maybe you could create a qvd with variable name and variable value.
In this case you could have more than one variable in your qvd file...
After when you load it you do a loop to retrieve all variables names and values...
To test, but I think that should work...
No I don't have an example for the time being, But I will try that tomorrow...
Finally I did it,
In this example variables are loaded from an inline table, but from a qvd this is the same:
tables_variables:
LOAD * INLINE [
Variable_name, Variable_value
asterix, smart
obelix, big
idefix, fast
];
for i=0 to noofrows('tables_variables')-1
LET var_name= peek('Variable_name',i,'tables_variables');
LET $(var_name) = peek('Variable_value',i,'tables_variables');
next i
Just reload and ... Tada ...
Thanks for your solutions. They will help me to solve the problem. But they also show me that there seems to be no way to just copy variables and their values from a qvw-File to a qvd-File and from there to another qvw-File. I will have to convert variables into internal tables.
Greetings,
S. Wegener