Page 1 of 1

bookmark and subroutines in purebasic editor

Posted: Sat Nov 08, 2003 10:29 am
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

Posted: Sat Nov 08, 2003 10:42 am
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?

Posted: Sat Nov 08, 2003 2:53 pm
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

Posted: Sun Nov 09, 2003 9:07 am
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

Posted: Sun Nov 09, 2003 9:13 am
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.

Posted: Sun Nov 09, 2003 11:04 am
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