cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
Karl Wir_n
Advocate

UI_PICT_PUSHCHECKBUTTON{2} with boolean array?

I'm trying to use UI_PICT_PUSHCHECKBUTTON{2} to set values in a 3-dimensional boolean array. This doesn't work correctly. When switching to a 1-dimensional array it works as expected. Is there a limitation that is not mentioned in the GDL Reference Guide?
/Karl W
5 Replies 5
Jochen Suehlo
Moderator Emeritus
What is a 3-dimensional Array in GDL ?
Array[1][1][1] ist not available in GDL, only 2-dimensional.
Jochen Suehlo . AC12-29 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
Karl Wir_n
Advocate
Sorry, I meant 2-dimensional. The question remains though.
Karl
Palawat
Expert
I just tested it and it seems to work fine for me.

For a quick test, I created a boolean parameter "bTest" and made it bTest[4][4]

UI Script ;

dim testTxt[4][4]
for i = 1 to 4
	for j = 1 to 4
		testTxt = "Dim1 =" + str(i, 1, 0) + ", Dim2 =" + str(j, 1, 0)
	next j
next i

!-----------------------------------------------
! Try changing i and j below
i = 1	! Use value between 1 to 4
j = 1	! Use value between 1 to 4
!-----------------------------------------------

UI_PICT_PUSHCHECKBUTTON{2} bTest, testTxt, "",         
	1, 10, 40, 120, 120
Archicad 29, Windows 10, Corei7 3.4 GHz, 32 GB Ram.
https://www.indigofigs.com
https://www.facebook.com/indigofigs
JaseBee
Advocate
Yeah I just ran into this problem too, it seems that the second array dimension isn't taken into account.

For example Parameter[3][1] will actually change Parameter[3][3], like wise for [2][1] changing [2][2].

It's basically turning a 2 dimension array into a 1 dimension array down the diagonal.

Pretty frustrating.

And while on the topic, none of the written pushbutton options for boolean parameters respond to the UI_STYLE settings.
AC 24 5004 AUS
iMac OSX (10.13.6) 4.2ghz i7
8gb ram/8gb vram
Podolsky
Ace
I'm afraid, guys, UI_PICT_PUSHCHECKBUTTON{2} is working with boolean only, that can be only 1 or 0. Without any arrays.
My advice - create necessary variable for the button (I often user UI-prefix for such variables) and if there is dependency between arrays in the script and this button variable - use PARAMETERS in parameter script to set the value.
I have learned, that sometimes just re-organising the algorithm of the script differently can solve almost unsolvable parts.

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!