bookmark and subroutines in purebasic editor

Working on new editor enhancements?
Behnood
User
User
Posts: 72
Joined: Fri Apr 25, 2003 10:07 pm
Location: Australia
Contact:

bookmark and subroutines in purebasic editor

Post by Behnood »

hi
is it possible to bookmark a line of code in purebasic editor or in jaPBe?
actually i want to add start line of subroutines in my code, cause i use so many subroutines in my code.

another thing (that may be i must post it in wishlist), in old qbasic editor we had a main page and for adding functions and subroutines we could open a new page (by pressing f4 or f6,i'm not sure). in this case we could switch between them easily and the main code view was more organised. the finall file will contain all subroutines and functions like purebasic ones, but in edit environment we saw them seperately.
i think this can be so good.
regards
Reza Behnood
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

afaik there's is no such thing in the editor as marking a position in the code with a keyboard combination, editing somewhere else, then jumping back to that specific position in the source

(if someone else knows better, please tell me)

you could, however, mark lines in the procedure browser, by using as the first two characters of the line ";" and "-"

Code: Select all

; normal comment
;- bookmark line
this works in japbe and pbe

why do you use gosub / return / subroutines instead of procedures, if i may ask?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

On japbe you can switch the actual code with:
* Ctrl+F6 / Ctrl+PageDown / Ctrl+Alt+Right -> Next Source
* Ctrl+Shift+F6 / Ctrl+PageUp / Ctrl+Alt+Left -> previous Source

Use XIncludeFile "subroutines.pbi" in the mainfile and save your subroutines in this pbi, then it is possible to use more than one file.

GPI
Behnood
User
User
Posts: 72
Joined: Fri Apr 25, 2003 10:07 pm
Location: Australia
Contact:

Post by Behnood »

i use subroutines insteed of procedures cause i can't handle vaiables!:)
actually my programming skill isn't enough for that. i use all variables as global, cause it is easier for me!:)
by the way it can be useful if we have them in seperate pages.
regards
Reza
Codemonger
Enthusiast
Enthusiast
Posts: 384
Joined: Sat May 24, 2003 8:02 pm
Location: Canada
Contact:

Post by Codemonger »

I totally agree, the procedure code should be seperate, just to organize it much better. In the meantime I just use multiple include files, and toggle between them.
<br>"I deliver Justice, not Mercy"

    - Codemonger, 2004 A.D.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

i think it's more a matter of programming style than anything else...

here's how i do it, in pseudocode:

Code: Select all

procedure x_init()
 blablabla intialisations variables constants arrays whatever
endprocedure

procedure x_subroutine1
  blablabla
endprocedure

procedure x_subroutine2
  blablabla
endprocedure

procedure x_mainloop
  blablabla
  call subroutine1
  ;- i'm editing here
  call whateverothersubroutines
endprocedure

x_mainloop()

if you build code up this way, the procedure browser does exactly what you want, with a click you can edit your procedure, with another click on ;-imeditinghere you're back where you were working in your main code
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Post Reply