In the script enclosed, it is proposed to the user to select one directory in a list.
The selection is stored in a list of strings called "choixproduits".
The variable "produit" is set to the value of the first element of the list at line 38.
My concern is that it returns an empty string. Probably a problem in string of caracters manipulation, but I can't figure out how to solve this issue.
Thanks in advance is anybody has the solution!
Go to Solution
Since the window is not modal, the assignment produit = Choixproduits; is executed before the user has a chance to click ok. That's why produit is empty.
Either make the window modal, or put the assignment within the button script.
produit = (RESP << Get selected)
View solution in original post
Thanks a lot, you gave me the clue!
I finally added a flag preventing any further JSL statement to be executed before the OK button has been clicked by the user:
/* Create a flag that will be set when the user dismisses the window */
while_flag = 0;
V List Box(
Button Box( "OK",
produit = (RESP << Get selected);
while_flag = 1; // Flag changes to 1
nw << Close Window;
/* If while_flag is 0, JMP will wait */
While( !while_flag, Wait( 0.1 ) );