Page 1 of 1

Posted: Tue Aug 06, 2002 11:33 pm
by BackupUser
Restored from previous forum. Originally posted by PB.

Does ProcedureReturn exit a procedure as soon as it's called, or does the
procedure still have to flow through to the EndProcedure command?


PB - Registered PureBasic Coder

Posted: Tue Aug 06, 2002 11:48 pm
by BackupUser
Restored from previous forum. Originally posted by freak.

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

Posted: Tue Aug 06, 2002 11:52 pm
by BackupUser
Restored from previous forum. Originally posted by Franco.

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
 
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

Posted: Wed Aug 07, 2002 1:33 am
by BackupUser
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

Posted: Wed Aug 07, 2002 7:09 pm
by BackupUser
Restored from previous forum. Originally posted by Andre.

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
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 ***

Posted: Thu Aug 08, 2002 3:26 am
by BackupUser
Restored from previous forum. Originally posted by Franco.

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
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 ***
Thanks, I overlooked that (sorry).

BTW: You could also use 'Procedure$'.

Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.

Posted: Thu Aug 08, 2002 3:28 am
by BackupUser
Restored from previous forum. Originally posted by PB.

> BTW: You could also use 'Procedure$'.

Yes, but then that procedure won't appear in the drop-down navigator.


PB - Registered PureBasic Coder

Posted: Thu Aug 08, 2002 3:31 am
by BackupUser
Restored from previous forum. Originally posted by Franco.
> BTW: You could also use 'Procedure$'.

Yes, but then that procedure won't appear in the drop-down navigator.


PB - Registered PureBasic Coder
Thanks, I never used the drop-down navigator...

Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.

Posted: Thu Aug 08, 2002 5:04 am
by BackupUser
Restored from previous forum. Originally posted by PB.

> Thanks, I never used the drop-down navigator...

How the heck do you navigate your long source codes?


PB - Registered PureBasic Coder

Posted: Thu Aug 08, 2002 5:21 pm
by BackupUser
Restored from previous forum. Originally posted by Franco.
How the heck do you navigate your long source codes?
Long Source Codes? Me? Nop!

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