Stopping a procedure

Just starting out? Need help? Post your questions and find answers here.
Rookie
Enthusiast
Enthusiast
Posts: 106
Joined: Tue May 20, 2003 4:16 pm
Location: Florida
Contact:

Stopping a procedure

Post by Rookie »

Since I have been searching for a solution for 30 minutes right and cant seem to put a correct string combo in the search box I asked probably a simple question.

I want to stop a produre from going on once I get to a certain point in a IF statement. Anyway to do this?
Insanity is over rated, unless you can join me in mine.
Don't post questions at work
Don't post questions at work
Don't post questions at work
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

Like this?

Code: Select all

Procedure MyFunction(Value)
	If Value = 10
		ProcedureReturn 0
	EndIf
	
	MessageRequester("Notice","This dialog will never show!",64)
EndProcedure

MyFunction(10)
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Rookie
Enthusiast
Enthusiast
Posts: 106
Joined: Tue May 20, 2003 4:16 pm
Location: Florida
Contact:

Post by Rookie »

Yep like that. I knew it would be something simple.
Insanity is over rated, unless you can join me in mine.
Don't post questions at work
Don't post questions at work
Don't post questions at work
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Don't need to return any value, just
ProcedureReturn
is what you need to finish and exit from the procedure.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

Psychophanta wrote:Don't need to return any value, just ProcedureReturn is what you need to finish and exit from the procedure.
If you don't intend to use inline assembly yes, otherwise no.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Fluid Byte wrote:
Psychophanta wrote:Don't need to return any value, just ProcedureReturn is what you need to finish and exit from the procedure.
If you don't intend to use inline assembly yes, otherwise no.
:o :?:
Sorry, but nothing to do with inline asm. :roll:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

Fluid Byte wrote:
Psychophanta wrote:Don't need to return any value, just ProcedureReturn is what you need to finish and exit from the procedure.
If you don't intend to use inline assembly yes, otherwise no.
I get your point (ProcedureReturn returns EAX when no value is given) but it
doesn't matter - Rookie just wants to exit the procedure. Psychophanta is right.
Good programmers don't comment their code. It was hard to write, should be hard to read.
Post Reply