cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
GDL
About building parametric objects with GDL.

Empty subroutine breaks Interface Preview

Laurentiu
Enthusiast

Hi,

 

I think I've found a bug with the Interface Preview of the GDL interface.

I've definitely encountered it before many times, but now I can actually reproduce it.

 

In short, whenever I introduce an erroneous subroutine and I run the Preview button it will break all future instances of the Preview even after I remove the problematic code.

The only way to get the Preview to work afterwards, is to re-open the object and press Preview again. Then it works fine.

 

I'm running Archicad 28.3.1 (6100) INT  on Windows 10.

Please let me know if it's only me or it's definitely a bug.

 

So here are 3 steps to reproduce it.

! Part one. Make a new object from scratch, and copy the following code in the Interface tab.
! ------------------------------------------------------------------------
ui_page 1, -1, "Page 1 Settings"
ui_outfield "Page 1", 1, 0

ui_page 2, -1, "Page 2 Settings"
ui_outfield "Page 2", 1, 0
! ------------------------------------------------------------------------
! Make sure you have the Hierarchical Pages active.
! You can run Check Script & Preview - all works fine.
! ------------------------------------------------------------------------


! Part Two. Copy the following code, where we introduce a subroutine without anything in it. 
! ------------------------------------------------------------------------
ui_page 1, -1, "Page 1 Settings"
ui_outfield "Page 1", 1, 0
	
ui_page 2, -1, "Page 2 Settings"
ui_outfield "Page 2", 1, 0

"Page1":
return
! ------------------------------------------------------------------------
! Run Check Script.
! You get "Return without Gosub" error.
! Run the Preview once, it looks like it works, but pages don't actually switch (check the text)
! Close the Preview and run again, and it's clearly broken.
! ------------------------------------------------------------------------


! Part three. Ok now let's try and fix it by removing the subroutine.
! Copy this clean code again.
! ------------------------------------------------------------------------
ui_page 1, -1, "Page 1 Settings"
ui_outfield "Page 1", 1, 0
	
ui_page 2, -1, "Page 2 Settings"
ui_outfield "Page 2", 1, 0
! ------------------------------------------------------------------------
! Run Check Script. It's OK.
! Run the Preview, and it's still broken. Idk why.
! To get the Preview working again, save the object & reopen it.
! ------------------------------------------------------------------------

 

Edit: I've also tested it on Archicad 29, Windows 11, and it's the same behaviour.

Laurentiu Cauni | Architect | AC 17-28 INT
Windows for AC & iOS for BIMx
2 REPLIES 2
Barry Kelly
Moderator

I have always written it like this.

 

iPageIDRoot 		=-1
iPageIDPage1		= 1
iPageIDPage2		= 2


! ==============================================================================
!UI_PAGES
! ==============================================================================

	UI_PAGE iPageIDPage1, iPageIDRoot, `Page 1 Settings`
		gosub "Page1"

	UI_PAGE iPageIDPage2, iPageIDRoot, `Page 2 Settings`
		gosub "Page2"


! ==============================================================================
END
! ==============================================================================


! ==============================================================================
!SUBROUTINES
! ==============================================================================




"Page1":
return



"Page2":
return

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

Thank you Barry, I do understand how to write subroutines for the interface, I've learned it from Bruce 😀

My point was that the Interface Preview is bugging after previewing it with empty subroutines (and no "end' statements").

My expected behaviour would be that the Preview would revert back to normal, and show the interface correctly after the code was fixed.

I don't think it's expected to have to re-open the object just to preview the interface script.

Laurentiu Cauni | Architect | AC 17-28 INT
Windows for AC & iOS for BIMx

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!