ProcedureReturn question
-
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.
Yes, it returns, see yourself:
--
If it stinks, it's chemistry. If it moves, it's biology.
If it does not work, It's computer science.
Edited by - freak on 07 August 2002 00:48:53
Yes, it returns, see yourself:
Code: Select all
Procedure.l Test()
ProcedureReturn 1
MessageRequester("Test","didn't return",0)
EndProcedure
;CallDebugger
a = Test()
MessageRequester("","done.",0)
End
--
If it stinks, it's chemistry. If it moves, it's biology.
If it does not work, It's computer science.
Edited by - freak on 07 August 2002 00:48:53
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Franco.
You can have several ProcedureReturns like:
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Edited by - franco on 07 August 2002 00:53:56
You can have several ProcedureReturns like:
Code: Select all
Procedure Australia(Where.s)
If Where.s = "Sidney"
ProcedureReturn "Capital"
;the procedure ends here
Else
ProcedureReturn "Elsewhere"
;the procedure ends here
EndIf
EndProcedure
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Edited by - franco on 07 August 2002 00:53:56
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> Procedure.l Test()
> ProcedureReturn 1
> MessageRequester("Test","didn't return",0)
> EndProcedure
Thanks, I should have done a test myself, but had to go out and was
hoping an answer would be here when I got back.
PB - Registered PureBasic Coder
> Procedure.l Test()
> ProcedureReturn 1
> MessageRequester("Test","didn't return",0)
> EndProcedure
Thanks, I should have done a test myself, but had to go out and was
hoping an answer would be here when I got back.
PB - Registered PureBasic Coder
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Andre.
Just a little note: to use this example correctly, the Procedure.s (keyword with type parameter) must be used. Else the compiler returns a numerical value...
Regards
André
*** German PureBasic Support ***
Code: Select all
Procedure Australia(Where.s)
If Where.s = "Sidney"
ProcedureReturn "Capital"
;the procedure ends here
Else
ProcedureReturn "Elsewhere"
;the procedure ends here
EndIf
EndProcedure
Regards
André
*** German PureBasic Support ***
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Franco.
BTW: You could also use 'Procedure$'.
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Thanks, I overlooked that (sorry).Just a little note: to use this example correctly, the Procedure.s (keyword with type parameter) must be used. Else the compiler returns a numerical value...Code: Select all
Procedure Australia(Where.s) If Where.s = "Sidney" ProcedureReturn "Capital" ;the procedure ends here Else ProcedureReturn "Elsewhere" ;the procedure ends here EndIf EndProcedure
Regards
André
*** German PureBasic Support ***
BTW: You could also use 'Procedure$'.
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
-
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 Franco.
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Thanks, I never used the drop-down navigator...> BTW: You could also use 'Procedure$'.
Yes, but then that procedure won't appear in the drop-down navigator.
PB - Registered PureBasic Coder
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
-
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 Franco.
Two Words: Include Files
BTW: I stopped coding some weeks ago because of time issues anyway.
Maybe one fine day I have more time and my projects can grow and get bigger and bigger, and I will have long source codes...
@Francois: Had no time to make the changes... If you like, you can release the code as it is. Sorry for that...
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Edited by - Franco on 08 August 2002 18:29:42
Long Source Codes? Me? Nop!How the heck do you navigate your long source codes?
Two Words: Include Files
BTW: I stopped coding some weeks ago because of time issues anyway.
Maybe one fine day I have more time and my projects can grow and get bigger and bigger, and I will have long source codes...
@Francois: Had no time to make the changes... If you like, you can release the code as it is. Sorry for that...
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Edited by - Franco on 08 August 2002 18:29:42