Page 1 of 1

Question about coding technique

Posted: Tue Mar 26, 2024 4:11 pm
by TexasGoat
While studying a PB Forum spreadsheet example "GridExModule.pbi", I came across some code I cannot find any help\explanation on how it works.

This is psuedo-code inside a module:

Procedure CallMe_ABC()
Procedure CallMe_XYZ()
Procedure CallMe_123()
Procedure CallMe()
--- Some code here ---
CallMe_ABC()
CallMe_XYZ()
CallMe_123()
--- Some code here ---
EndProcedure

My confusion is on the lack of "EndProcedure" statements (based on my assumption a "Procedure" statement requires an "EndProcedure" for the compiler. An obviously wrong assumption because the code in "GridExModule.pbi" compiles and runs quite nicely on my PC.

So, how does this work? Any help\explanation would be appreciated. Thanks!

Re: Question about coding technique

Posted: Tue Mar 26, 2024 4:17 pm
by Fred
Something is missing as it can't work like that.

Re: Question about coding technique

Posted: Tue Mar 26, 2024 4:22 pm
by spikey
There must be one somewhere. The compiler will halt with an error, if there isn't. It's possible that you can't currently see it though. The IDE supports code folding which may be causing parts of the code to be hidden. Check for small + marks in boxes adjacent to line numbers. These indicate sections which have been folded up. Click the mark to unfold it.

Thorsten, who wrote the module you're looking at, uses this feature quite a bit.

See the section "Folding options" in the help article Editing features, which explains more about it.

Re: Question about coding technique

Posted: Tue Mar 26, 2024 4:40 pm
by skywalk
Please post the GridExModule version you are using?
; ---------------------------
; Last Update: 30.10.2018
; ---------------------------
I cannot find the code you show? Maybe that is an example file?

Re: Question about coding technique

Posted: Tue Mar 26, 2024 4:52 pm
by TexasGoat
Thanks spikey! It was folded up!

Re: Question about coding technique

Posted: Tue Mar 26, 2024 5:18 pm
by Quin
Just as a quick tip, you can also press F4 to fold the current block, or control+f4 to fold all blocks at the given level.