Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
marco_puccetti
Partner - Creator
Partner - Creator

Config file inclusion

Hello i need to know if the LOAD INLINE statement included in a config file are visible in the script at the reload process.

I have a table like this:

TAB:

LOAD * INLINE [

A, B

VAL1, VAL2

];

in the config file included with this statement $(include=../SETTINGS/config.txt);


but when i use this expression in the script: LET noRows = NoOfRows('TAB');

i get NULL.

Is it correct?


Thanks

Marco

33 Replies
Gysbert_Wassenaar

$(include=....); will fail silently if something goes wrong.

Try $(Must_include=../SETTINGS/config.txt); to make sure that you get an error if the config.txt file can't be loaded.


talk is cheap, supply exceeds demand
Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

As gwassenaar mentioned yes Must_Include is best option as it will alert you when it fails. However what am thinking of it why don't you test your include with full file path, the UNC path might not be right.

marco_puccetti
Partner - Creator
Partner - Creator
Author

Now it's working.

Thanks

Marco

marco_puccetti
Partner - Creator
Partner - Creator
Author

I have tried with the absolute path as you have mentioned but now it's not working in both methods.

Now the table is not visible with the LET noRows = NoOfRows('TAB'); statement.

How can i do?

Thanks

Marco

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Load the Table TAB into QV , as in the script inside the txt file and use your variable noRows instead of include.

If possible share your file and the txt file for the include

maxgro
MVP
MVP

use must_include

check in table viewer after reload the table is created

add some trace


$(must_include=../SETTINGS/config.txt);

LET noRows = NoOfRows('TAB');

trace noRows=$(noRows);

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Maybe you should try a path specification with backslashes (e.g. \) instead of forward slashes (e.g. /)...

Peter

marco_puccetti
Partner - Creator
Partner - Creator
Author

I have used the absolute path to locate the config file, but after having inserted another definition in the config file, i get null value when i try to get the NoOfRows('TAB1'); value.

What can i do to get the correct value?

Thanks

Marco

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Usually this means that the TAB1 table does not exist. Are you sure it is there when you call NoOfRows()? Use the Debug option in your script editor, or add Trace statements to get an idea of the path the execution engine follows in reality.

Best,

Peter