Page 1 of 1

Tags Label Regions

Posted: Wed Nov 29, 2023 11:16 pm
by AZJIO
I made a selection of how to mark a section of code.

Code: Select all

;- ### Constants ###
;- ●●● Declare ●●●
;-›››››› Global ‹‹‹‹‹‹
;-‴‴‴‴‴‴ Define ‴‴‴‴‴‴
;-► GUI ◄
;- ╔═ GUI ═╗
; Code
;- ╚═ GUI ═╝

;-┌──Loop──┐
; Code
;-└──Loop──┘

;-█ Loop
;-…… Gadget Events ……
;-…… Menu events ……

;- - - - Resize Gadget - - - -
;- - - - Drag and drop files - - - -
;- ╒══ Procedure ══╕
; Code
;- ╘════ End ════╛
;- ╓──Func──╖
; Code
;- ╙──End──╜
;- ██ current place of work ██
;- ▓▓ Region ▓▓
;- ▒▒ Region ▒▒
;- ░░ Region ░░
;-⁞⁞⁞⁞⁞⁞ Region ⁞⁞⁞⁞⁞⁞
;-≡≡≡ Region ≡≡≡
;-₪₪₪ Region ₪₪₪
;-♫♫♫ Region ♫♫♫
;-••• Region •••
;-■■■ Region ■■■
;-◘◘◘ Region ◘◘◘
;- ▬▬ Region ▬▬
;- ―― Region ――
;- !i!i!i!i Region !i!i!i!i
;- װװװװװ Region װװװװװ
;- ∕∕∕∕∕∕∕∕∕∕ Region ∕∕∕∕∕∕∕∕∕∕
;- ♦♦♦ Region ♦♦♦
;- ₩₩₩ Region ₩₩₩
;- ₦₦₦ Region ₦₦₦
;- ≠≠≠≠ Region ≠≠≠≠
;- ꞮꞮꞮ Region ꞮꞮꞮ
;- ֍֍֍ Region ֍֍֍
;- ꜜꜜꜜ Region ꜜꜜꜜ
;- ꜛꜛꜛ Region ꜛꜛꜛ
;- ⱶⱶⱶⱶⱶ Region ⱶⱶⱶⱶⱶ
;- ᴥᴥᴥ Region ᴥᴥᴥ
;- ¦¦¦¦¦¦¦¦¦¦ Region ¦¦¦¦¦¦¦¦¦¦
;- ⌂⌂⌂ Region ⌂⌂⌂
;- ≈≈≈ Region ≈≈≈
;- ~~~ Region ~~~
;-  ⃰  ⃰  ⃰ Region ⃰  ⃰  ⃰ 
;- ‡‡‡‡‡‡‡‡‡‡‡
;- ∑∑∑∑∑∑∑∑∑∑
;-▲▲▲▲▲▲▲▲
;-▼▼▼▼▼▼▼▼
;-▼▲▼▲▼▲▼▲
;-▲▼▲▼▲▼▲▼

Re: Tags Label Regions

Posted: Thu Nov 30, 2023 1:41 am
by mk-soft

Code: Select all

;-TOP

;- Begin Region A
;{
Procedure foo()
  
EndProcedure

Procedure foo2()
  
EndProcedure

;}
;- End Region A

;- Begin Region B
;{
Procedure fc()
  
EndProcedure

Procedure fc2()
  
EndProcedure

;}
;- End Region b


;- Begin Main
;{
Global var
foo()
;}
;- End Mains

Re: Tags Label Regions

Posted: Thu Nov 30, 2023 9:23 am
by SPH
AZJIO wrote: Wed Nov 29, 2023 11:16 pm I made a selection of how to mark a section of code.

Code: Select all

;- ### Constants ###
;- ●●● Declare ●●●
;-›››››› Global ‹‹‹‹‹‹
;-‴‴‴‴‴‴ Define ‴‴‴‴‴‴
;-► GUI ◄
;- ╔═ GUI ═╗
; Code
;- ╚═ GUI ═╝

;-┌──Loop──┐
; Code
;-└──Loop──┘

;-█ Loop
;-…… Gadget Events ……
;-…… Menu events ……

;- - - - Resize Gadget - - - -
;- - - - Drag and drop files - - - -
;- ╒══ Procedure ══╕
; Code
;- ╘════ End ════╛
;- ╓──Func──╖
; Code
;- ╙──End──╜
;- ██ current place of work ██
;- ▓▓ Region ▓▓
;- ▒▒ Region ▒▒
;- ░░ Region ░░
;-⁞⁞⁞⁞⁞⁞ Region ⁞⁞⁞⁞⁞⁞
;-≡≡≡ Region ≡≡≡
;-₪₪₪ Region ₪₪₪
;-♫♫♫ Region ♫♫♫
;-••• Region •••
;-■■■ Region ■■■
;-◘◘◘ Region ◘◘◘
;- ▬▬ Region ▬▬
;- ―― Region ――
;- !i!i!i!i Region !i!i!i!i
;- װװװװװ Region װװװװװ
;- ∕∕∕∕∕∕∕∕∕∕ Region ∕∕∕∕∕∕∕∕∕∕
;- ♦♦♦ Region ♦♦♦
;- ₩₩₩ Region ₩₩₩
;- ₦₦₦ Region ₦₦₦
;- ≠≠≠≠ Region ≠≠≠≠
;- ꞮꞮꞮ Region ꞮꞮꞮ
;- ֍֍֍ Region ֍֍֍
;- ꜜꜜꜜ Region ꜜꜜꜜ
;- ꜛꜛꜛ Region ꜛꜛꜛ
;- ⱶⱶⱶⱶⱶ Region ⱶⱶⱶⱶⱶ
;- ᴥᴥᴥ Region ᴥᴥᴥ
;- ¦¦¦¦¦¦¦¦¦¦ Region ¦¦¦¦¦¦¦¦¦¦
;- ⌂⌂⌂ Region ⌂⌂⌂
;- ≈≈≈ Region ≈≈≈
;- ~~~ Region ~~~
;-  ⃰  ⃰  ⃰ Region ⃰  ⃰  ⃰ 
;- ‡‡‡‡‡‡‡‡‡‡‡
;- ∑∑∑∑∑∑∑∑∑∑
;-▲▲▲▲▲▲▲▲
;-▼▼▼▼▼▼▼▼
;-▼▲▼▲▼▲▼▲
;-▲▼▲▼▲▼▲▼
Thank you for this original idea !

Re: Tags Label Regions

Posted: Mon Dec 11, 2023 6:34 am
by AZJIO
mk-soft wrote: Thu Nov 30, 2023 1:41 am

Code: Select all

;-TOP
I didn’t understand the meaning of the ;-TOP tag before

This is how the cycle looks better

Code: Select all

;-┌───Loop───┐
;-├ Gadget Events
;-├ Menu Events
;-└───Loop───┘

Code: Select all

;- ╔═ GUI ═╗
;- ╠ Buttons
;- ╠ Menu
;- ╚═ GUI ═╝

Re: Tags Label Regions

Posted: Mon Dec 11, 2023 7:16 am
by STARGÅTE
AZJIO wrote: Mon Dec 11, 2023 6:34 am This is how the cycle looks better

Code: Select all

;-┌───Loop───┐
;-├ Gadget Events
;-├ Menu Events
;-└───Loop───┘

Code: Select all

;- ╔═ GUI ═╗
;- ╠ Buttons
;- ╠ Menu
;- ╚═ GUI ═╝
Do we talk about the procedure list of the PB IDE? Or do we talk about the code itself?

Re: Tags Label Regions

Posted: Mon Dec 11, 2023 7:23 am
by AZJIO
If we insert these marks into the code in the positions where they begin, then the corresponding view will be shown in the list of procedures. When we click on them we go to the place where they are located. The list of procedures will show a logical view of the code structure. There is a beginning of a loop and an end of a loop, and inside them there is a tree of events, within which it is easy to navigate to the necessary sections of the code.
Perhaps you are using BindGadgetEvent() instead of a loop, then you don't have a loop as such. But you can apply this to other areas of the code to divide it into blocks.

Code: Select all

;- TOP
;- # Constants
#Window = 0
;- # Enumeration
Enumeration Gadget
EndEnumeration
;- ● Declare
Declare SizeWindowHandler()
;- ● Global
Global h
;- ● Define
Define w

;-┌───GUI───┐
If OpenWindow(#Window, 0, 0, w, h, Lng(5), #PB_Window_SystemMenu
;- ├ Buttons
	ButtonImageGadget(#btnOpen, w - 270, 120, 30, 30, ImageID(2))
;- ├ Menu
	If CreatePopupMenu(#MetaMenu)
	EndIf
;- ├ CheckBox
	CheckBoxGadget(#Ch_OnTop, 280, 2, 120, 20, "OnTop")
;-┌───Loop───┐
	Repeat
		Select WaitWindowEvent()
;-├ Menu events
			Case #PB_Event_Menu
;-├ Gadget Events
			Case #PB_Event_Gadget
				Select EventGadget()
					Case #PB_Event_CloseWindow
						End
				EndSelect
		EndSelect
	ForEver
;-└───Loop───┘
EndIf

;- ╒══ Procedure ══╕
Procedure SizeWindowHandler()
EndProcedure
;- ╘════ End ════╛

Re: Tags Label Regions

Posted: Mon Dec 11, 2023 9:09 am
by Caronte3D
Nice idea :wink:
(seems good candidate for a PB-Tool)

Re: Tags Label Regions

Posted: Mon Dec 11, 2023 9:45 am
by AZJIO
Caronte3D wrote: Mon Dec 11, 2023 9:09 am (seems good candidate for a PB-Tool)
I'm using AutoCompletionIDE. I added embed tags. Open the file "2-Tracing_paper.lst" and add these lines:

Code: Select all

Tag GUI|;-┌───GUI───┐
Tag Loop|;-┌───Loop───┐
Tag Loop End|;-└───Loop───┘
Tag Buttons|;- ├ Buttons
Tag Menu|;- ├ Menu
Tag CheckBox|;- ├ CheckBox
Tag Menu Events|;-├ Menu Events
Tag Gadget Events|;-├ Gadget Events
Tag Procedure|;- ╒══ Procedure ══╕
Tag End|;- ╘════ End ════╛
Tag Constants|;- # Constants
Tag Enumeration|;- # Enumeration
Tag Declare|;- ● Declare
Tag Global|;- ● Global
Tag Define|;- ● Define

Re: Tags Label Regions

Posted: Mon Dec 11, 2023 9:00 pm
by Caronte3D
Nice!
You forgot:

Code: Select all

Tag GUI End|;-└───GUI───┘