Program Labels?

Blitz3D Forums/Blitz3D Beginners Area/Program Labels?

Pete Carter(Posted 2008) [#1]
Hi it just hit me today that I have no idea what program labels are and how to use them? I have the printed manual and it only has one line that just says that you can't use any of the basic commands as varibles, fuction names or labels etc. thats it theres no info on what they are or how to use them. As they have a tab just for them in the ide i guess they must be useful.

If someone can fill me in I would be most pleased.

thanks Pete


puki(Posted 2008) [#2]
I thought this was a program label:

goto skip

.skip


gosub whatever

.whatever


Ross C(Posted 2008) [#3]
Puki is correct. I sometimes use labels to skip to certain points in my code. If you look in the functions box in the IDE, it has a tab for labels. I use that if i have a big source code, to skip to certain sections.


Pete Carter(Posted 2008) [#4]
so if i type

.mainloop


infront of the main loop it will have no effect on the program, i can just use the tab on the right to jump to the line.

if so this is handy

i give it a go thanks for your help guys


Cp(Posted 2008) [#5]
In running the program, yes. Its used with goto and gosub to run certain parts of a program. It IS a command to some extent.

In the Ide, no, though it can be used as a place to mark, you should use comments for marking places in source code.


GfK(Posted 2008) [#6]
In the Ide, no, though it can be used as a place to mark, you should use comments for marking places in source code.
Or get a proper IDE that lets you use bookmarks.


Cp(Posted 2008) [#7]
I do have it, I just prefer to use comments.
Its just my programming "style".


Pete Carter(Posted 2008) [#8]
for me i guess ive just over commented, i may just use them as markers and then delete them once the programs done. ive never need to use goto or go sub yet so i guess it maybe useful in the future