We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2016-06-03 05:52 AM
param_1which is a boolean variable
i = 0 FOR i=1 TO 6 STEP 1 mystring = 'param_' + str(i,1,0) NEXT iI then want to use the generated param name in the same loop
i = 0 FOR i=1 TO 6 STEP 1 mystring = 'param_' + str(i,1,0) if mystring = 1 Then ! // code related to if checkbox is checked (TRUE/ON/1) else ! // code related to if checkbox is NOT checked (FALSE/OFF/0) endif NEXT iThe code below does work!!
i = 0 FOR i=1 TO 6 STEP 1 mystring = 'param_' + str(i,1,0) UI_INFIELD mystrng, base_posx, base_posy, 20, 20 NEXT i
2016-06-03 09:30 AM
2016-06-07 04:30 AM
Bruce wrote:Thanks for this Bruce,
Matrices are your friend in this situation. You can't use a loop to create a variable name (as you can in other languages), but you can populate and query / test the contents of a matrix.
DIM arrayName[] is how you declare (or DIM arrayName[][] for a 2-dimension array)
Hope this helps.