Restored from previous forum. Originally posted by julianbury.
 I power-searched the whole C:\Program Files\PureBasic folder and cannot find a single reference to the word "Label". 
Obviously, this is the wrong word. What is the right word?
^00^
			
			
									
									
						Can't find "Label" anywhere
- 
				BackupUser
- PureBasic Guru 
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by tinman.
 
There is no keyword or command called "Label" though. To write a label in your code you simply write some text and put a colon after it:
--
I used to be a nihilist but I don't believe in that any more.
(Win98first ed. + all updates, PB3.51, external editor)
			
			
									
									
						The word label is in the reference manual at both places you would expect: Gosub and Goto (Goto is in the "Other" section).Originally posted by julianbury
I power-searched the whole C:\Program Files\PureBasic folder and cannot find a single reference to the word "Label".
There is no keyword or command called "Label" though. To write a label in your code you simply write some text and put a colon after it:
Code: Select all
OpenConsole()
Goto hereismylabel
PrintN("Never see me")
hereismylabel:
PrintN("Press return to exit")
Input()
CloseConsole()
End
--
I used to be a nihilist but I don't believe in that any more.
(Win98first ed. + all updates, PB3.51, external editor)
- 
				BackupUser
- PureBasic Guru 
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by WolfgangS.
Hi !
A label is a kind of tag which shows you a certain line in your sourcecode where you can jump to.
Look at the following sourcecode and you will understand how to use it. The labels are "label1:" and "smoke:". The ":" identifies it as label.
Please note: In modern und good programming (languages) you really don´t need it (usually).
MFG
WolfgangS
Doh, tinman was 4 minutes faster ...
			
			
									
									
						Hi !
A label is a kind of tag which shows you a certain line in your sourcecode where you can jump to.
Look at the following sourcecode and you will understand how to use it. The labels are "label1:" and "smoke:". The ":" identifies it as label.
Please note: In modern und good programming (languages) you really don´t need it (usually).
MFG
WolfgangS
Code: Select all
OpenConsole()  PrintN("Test 1")
  Goto label1:
  PrintN("Test 2")
label1:
  PrintN("Test 3")
  Goto smoke:
  PrintN("Test 4")
smoke:
  PrintN("Test 5")
  Delay(5000)
End
Doh, tinman was 4 minutes faster ...
- 
				BackupUser
- PureBasic Guru 
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
- 
				BackupUser
- PureBasic Guru 
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by freak.
I guess what you search is a TextGadget()
Timo
-------------------------------
http://freak.coolfreepages.com/
			
			
									
									
						I guess what you search is a TextGadget()
Timo
-------------------------------
http://freak.coolfreepages.com/
- 
				BackupUser
- PureBasic Guru 
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm

