Tags Label Regions

Everything else that doesn't fall into one of the other PB categories.
AZJIO
Addict
Addict
Posts: 1354
Joined: Sun May 14, 2017 1:48 am

Tags Label Regions

Post 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 ⃰  ⃰  ⃰ 
;- ‡‡‡‡‡‡‡‡‡‡‡
;- ∑∑∑∑∑∑∑∑∑∑
;-▲▲▲▲▲▲▲▲
;-▼▼▼▼▼▼▼▼
;-▼▲▼▲▼▲▼▲
;-▲▼▲▼▲▼▲▼
User avatar
mk-soft
Always Here
Always Here
Posts: 5380
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Tags Label Regions

Post 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
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
SPH
Enthusiast
Enthusiast
Posts: 268
Joined: Tue Jan 04, 2011 6:21 pm

Re: Tags Label Regions

Post 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 !
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 5.73LTS - 32 bits
AZJIO
Addict
Addict
Posts: 1354
Joined: Sun May 14, 2017 1:48 am

Re: Tags Label Regions

Post 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 ═╝
User avatar
STARGÅTE
Addict
Addict
Posts: 2084
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Tags Label Regions

Post 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?
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
AZJIO
Addict
Addict
Posts: 1354
Joined: Sun May 14, 2017 1:48 am

Re: Tags Label Regions

Post 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 ════╛
User avatar
Caronte3D
Addict
Addict
Posts: 1047
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: Tags Label Regions

Post by Caronte3D »

Nice idea :wink:
(seems good candidate for a PB-Tool)
AZJIO
Addict
Addict
Posts: 1354
Joined: Sun May 14, 2017 1:48 am

Re: Tags Label Regions

Post 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
User avatar
Caronte3D
Addict
Addict
Posts: 1047
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: Tags Label Regions

Post by Caronte3D »

Nice!
You forgot:

Code: Select all

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