5 Replies Latest reply: Nov 4, 2009 12:07 PM by Sönke Wegener RSS

    variables in qvd-Files?

    Sönke Wegener
      • Is it possible to store variables in qvd-Files in order to read their values later?
      • How could that be accomplished?
        • variables in qvd-Files?
          Peter Rieper

          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

          • variables in qvd-Files?

            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.

              • variables in qvd-Files?

                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... Indifferent

                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...

                 

                  • variables in qvd-Files?

                    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 ...

                     

                      • variables in qvd-Files?
                        Sönke Wegener

                        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