cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
hogi
Level XI

run table script

What is the difference between running a Table Script via the green Play icon:

hogi_0-1715787025984.png

 

... and via the Run button?

hogi_1-1715787065873.png

 

12 REPLIES 12
hogi
Level XI

Re: run table script

Concerning my issue

 

Actually, at the end, it was kind of a timing issue

...like Jarmo described it - but kind of inverse:

 

I use a customized AddIn to load a file.

And as Main Menu cannot return a return value :(, I used current data table() to get access to the newly created table

this was the idea ... 

 

Main Menu("load_");
// wait(0);
dt= current data table(); // the idea: myDT
caption(dt << get name())

 

a) after opening the data table via Main Menu("load_") ,

 current data table in the table script still referred to my main table (!?!?!).

Activating the wait(0) solved the issue - with 1 second penalty fee.

 

b) To make it more robust (and faster),  I created a table reference :::load_:myTable inside load_ and used dt=:::load_:myTable instead of the original approach via current data table().

 

Interesting: 

The approach via :::load_:myTable works without the wait(0).
This means that I can already communicate with the new table before it gets the current data table()!

 

so, maybe worth to investigate, how fast data tables get the current data table()

... and why there are differences.

hogi
Level XI

Re: run table script

Coming back to the start of the discussion - the difference between the green play icon and the "run" button of the edit window:

@Byron_JMP wrote:

They generally do the same thing.

The little green arrow is faster, one click.

: )


 

the issue boils down to the finding that there is not ONE well define current data table()!

 

Using the green play button and checking the result windows, one can see the following sequence:

1) the AddIn opens test and reports that current data table was changed to test

2)  the main table still thinks that check_current_data_table is the current data table (!!!)

3) After the  wait(0)   it knows better and returns test

 

On the other hand - if the script is started via the RUN button in the edit window -  all 3 result windows show the same table as current data table()

 

 

 

main script:

Names Default To Here( 1 );
Main Menu( "load_" );

win = new window("1 ",Text Box ("main table (1):\!n" || 
(current data table() << get name())));

wait(1);
win = new window("2 ",Text Box ("main table (2):\!n" || 
(current data table() << get name())));

load_:

Names Default To Here( 1 );

dt = open("C:\temp\test.csv");

Caption( {100, 200}, "postprocessing ...");

win = new window("addIn", text box("inside the addin:\!n" ||(current data table()<< get name())));
// win  << moveWindow( 100, 100 );

Caption( remove );

 
Digging deeper, one finds out that tiny details like enabling the << moveWindow inside the AddIn or disabling one of the caption commands have an effect on the behavior.

hogi
Level XI

Re: run table script

By the way the same issue: 

 

there is not ONE well define current data table()!

 

was also the issue which triggered this post: ThisDataTable() ? 

 

with the same bugfix: 

add wait ( 0 )
in front of

dt = current data table()!