Tags Label Regions

Everything else that doesn't fall into one of the other PB categories.
AZJIO
Addict
Addict
Posts: 2254
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: 6506
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: 631
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 !

!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 : 6.12LTS - 64 bits
AZJIO
Addict
Addict
Posts: 2254
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: 2277
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: 2254
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: 1381
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: 2254
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: 1381
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───┘
Axolotl
Addict
Addict
Posts: 920
Joined: Wed Dec 31, 2008 3:36 pm

Re: Tags Label Regions

Post by Axolotl »

Nice, thanks for sharing.
Well, I am doing something similar, not even such fancy.
With this new start keyword i have the folding combined with the entry in the procedure list.

Code: Select all

; ==> Add ;-{ to the  Folding start Keywords (Menu: File | Preferences.... in Dialog: Preferences | Editor | Folding) 
;-{·} Usage: pbcompilerc "Filename" ..... 
; all the things I don't have to read every time 
;} End of Usage 
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5612
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Tags Label Regions

Post by Kwai chang caine »

Very nice tags 8)

Personaly, i use another and old simples personal tags :oops:

Code: Select all

; ##########################
;       PROCEDURES
;  ########################## 
Azjio wrote:I didn’t understand the meaning of the ;-TOP tag before
Yes... Me too :shock:
It's not really difficult to see It's the top of the page, when there are nothing above :mrgreen:
ImageThe happiness is a road...
Not a destination

PureBasic French Forum
Post Reply