Boîtes numériques dynamiques basées sur des éléments de listeDans le script suivant, j'ai une liste de 3 éléments et j'essaie de créer une nouvelle fenêtre où l'utilisateur peut saisir des valeurs pour chacun des éléments :
myList = {"apple", "banana", "orange"};
nw = New Window( "Enter Numbers",
<<MODAL></MODAL>I use the for loop because the number of the items in the list "myList" changes. So that I would like to happen also for the Number Edit Boxes. However, I get back the following:
<SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Georgios_Tsim_0-1724768252918.png" style="width: 400px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="Georgios_Tsim_0-1724768252918.png" style="width: 177px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="Georgios_Tsim_0-1724768252918.png" style="width: 177px;"><span class="lia-inline-image-display-wrapper" image-alt="Georgios_Tsim_0-1724768252918.png" style="width: 177px;"><img src="https://us.v-cdn.net/6038925/uploads/images/67570iD9F0C812C0FDFAEA/Georgios_Tsim_0-1724768252918.png" role="button" title="Georgios_Tsim_0-1724768252918.png" alt="Georgios_Tsim_0-1724768252918.png" /></span></SPAN></SPAN></SPAN>
Ideally I would like the values that the end user enters to be saved in a list.
<LINGO-LABS id="lingo-labs-785852" slang="en-US" mode="CREATE"><LINGO-LABEL>Automatisation et scripts</LINGO-LABEL></LINGO-LABS>Ré: Boîtes numériques dynamiques basées sur des éléments de listeVoici l’approche que j’adopterais
Names Default To Here( 1 );
myList = {"apple", "banana", "orange"};
myVList = V List Box(
Text Box( "Enter the values" ),
lub = Lineup Box( N Col( 2 ), ),
H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
);
For Each( {box}, myList,
lub << append( Text Box( Eval( box ) ) );
lub << append( Number Edit Box( 42 ) );
);
nw = New Window( "Enter Numbers",
<<MODAL></MODAL>
<P><SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1724769101857.png" style="width: 400px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="txnelson_0-1724769101857.png" style="width: 152px;"><span class="lia-inline-image-display-wrapper" image-alt="txnelson_0-1724769101857.png" style="width: 152px;"><img src="https://us.v-cdn.net/6038925/uploads/images/67571i70B066AB4D35A5C0/txnelson_0-1724769101857.png" role="button" title="txnelson_0-1724769101857.png" alt="txnelson_0-1724769101857.png" /></span></SPAN></SPAN></P>
<P> </P>Ré: Boîtes numériques dynamiques basées sur des éléments de listeIl existe plusieurs façons différentes de procéder.
Vous pouvez utiliser différentes méthodes pour collecter les résultats, vous pouvez utiliser XPath
Names Default To Here(1);
fruits = {"apple", "banana", "orange"};
value_collector = V List Box(
Text Box("Enter the values"),
lub = Lineup Box(N Col(2))
);
For Each({fruit}, fruits,
lub << append(Text Box(fruit));
lub << append(Number Edit Box(42));
);
nw = New Window("Enter Numbers", <<MODAL></MODAL>
<P>ou stocker les références à une liste</P>
<P> </P>
<P> </P>
<CODE class=" language-jsl">Names Default To Here(1);
fruits = {"apple", "banana", "orange"};
value_collector = V List Box(
Text Box("Enter the values"),
lub = Lineup Box(N Col(2))
);
nebs = {};
For Each({fruit}, fruits,
lub << append(Text Box(fruit));
lub << append(neb = Number Edit Box(42));
Insert Into(nebs, neb);
);
nw = New Window("Enter Numbers", <<MODAL></MODAL>
<P>ou tableau associatif</P>
<P> </P>
<CODE class=" language-jsl">Names Default To Here(1);
fruits = {"apple", "banana", "orange"};
value_collector = V List Box(
Text Box("Enter the values"),
lub = Lineup Box(N Col(2))
);
vals = Associative Array();
For Each({fruit}, fruits,
lub << append(Text Box(fruit));
lub << append(neb = Number Edit Box(42));
vals[fruit] = neb;
);
nw = New Window("Enter Numbers", <<MODAL></MODAL>
<P>Avec ceux-ci, vous aurez une interface utilisateur quelque chose comme ceci</P>
<P><SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1724770118276.png" style="width: 400px;"><span class="lia-inline-image-display-wrapper" image-alt="jthi_1-1724770118276.png" style="width: 175px;"><img src="https://us.v-cdn.net/6038925/uploads/images/67574i33AD25CCD1BE26A1/jthi_1-1724770118276.png" role="button" title="jthi_1-1724770118276.png" alt="jthi_1-1724770118276.png" /></span></SPAN></P>
<P>Ou vous pouvez utiliser des éléments de zone d'affichage totalement différents (zone de tableau et zone d'édition de colonnes de nombres)</P>
<CODE class=" language-jsl">Names Default To Here(1);
fruits = {"apple", "banana", "orange"};
nw = New Window("Enter Numbers", <<MODAL></MODAL>
<P><SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1724770072443.png" style="width: 400px;"><span class="lia-inline-image-display-wrapper" image-alt="jthi_0-1724770072443.png" style="width: 159px;"><img src="https://us.v-cdn.net/6038925/uploads/images/67573i6DD519A3AA61CFB2/jthi_0-1724770072443.png" role="button" title="jthi_0-1724770072443.png" alt="jthi_0-1724770072443.png" /></span></SPAN></P>
<P> </P>