Restored from previous forum. Originally posted by Amiga5k.
Hi, I'm new here!
Speaking of >> and <<, am I the only one who thinks these are backwards? << (pointing left) should be shift left, not shift right.
Also, I'm still looking over the docs, but what's this 'fakereturn' stuff? Is this only needed with goto commands? If so, no problem, as I haven't used goto since the good 'ol C-64 basic days...
Thanks
***I snatch kisses!***
Add this to PB3.50 Docs
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> what's this 'fakereturn' stuff?
It's for when you Gosub to a routine, but want to jump out of it with
Goto, without reaching the Return. Doing this is normally a no-no,
because the stack never gets cleared because Return isn't called.
But using FakeReturn before Goto clears the stack, keeping your app
stable. In other BASICS it's usually called "Pop", ie. Pop Gosub,
followed by the GoTo command.
> what's this 'fakereturn' stuff?
It's for when you Gosub to a routine, but want to jump out of it with
Goto, without reaching the Return. Doing this is normally a no-no,
because the stack never gets cleared because Return isn't called.
But using FakeReturn before Goto clears the stack, keeping your app
stable. In other BASICS it's usually called "Pop", ie. Pop Gosub,
followed by the GoTo command.
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Manolo.
The olds Basics (True-Basic, the authors and others) work all time with RETURN (If this is only RETURN, clear the stack) and if you want go to another position in the program the *RETURN Flag* clear the stack if the condiction is OK, if not, continue with the program to the next RETURN. "Pop Gosub"??? first time fo me.
Example:
FIRST:
Input A
GOSUB MYSUB
the next instruction
MYSUB:
If A=10
RETURN (Clear the stack)
Else
RETURN FIRST (Clear the stack)
Goto??? Sorry. Old system and 1 command more
FakeReturn??? Only for clear the stack.
Manolo
Hi PB,Originally posted by PB
> what's this 'fakereturn' stuff?
It's for when you Gosub to a routine, but want to jump out of it with
Goto, without reaching the Return. Doing this is normally a no-no,
because the stack never gets cleared because Return isn't called.
But using FakeReturn before Goto clears the stack, keeping your app
stable. In other BASICS it's usually called "Pop", ie. Pop Gosub,
followed by the GoTo command.
The olds Basics (True-Basic, the authors and others) work all time with RETURN (If this is only RETURN, clear the stack) and if you want go to another position in the program the *RETURN Flag* clear the stack if the condiction is OK, if not, continue with the program to the next RETURN. "Pop Gosub"??? first time fo me.
Example:
FIRST:
Input A
GOSUB MYSUB
the next instruction
MYSUB:
If A=10
RETURN (Clear the stack)
Else
RETURN FIRST (Clear the stack)
Goto??? Sorry. Old system and 1 command more
FakeReturn??? Only for clear the stack.
Manolo
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by tinman.

Just to point out a different point of view, I do not think I have ever seen the return command used with a label name
I agree that it might be better to have a single command for doing this. At the moment the possibility exists for the user to make a mistake by forgetting one of the commands. However, as separate commands, they can be useful for some tricks, such as
If you want to jump back 2 Gosubs in one position.
--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + SP1, PB3.40)
Goto an old system and you are wanting to use Gosub...Return? Ironic...Originally posted by Manolo
Goto??? Sorry. Old system and 1 command more
FakeReturn??? Only for clear the stack.

Just to point out a different point of view, I do not think I have ever seen the return command used with a label name

I agree that it might be better to have a single command for doing this. At the moment the possibility exists for the user to make a mistake by forgetting one of the commands. However, as separate commands, they can be useful for some tricks, such as
Code: Select all
FakeReturn
Return
--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + SP1, PB3.40)
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> "Pop Gosub"??? first time fo me.
It exists; mainly in the very old languages, but it's even in Blitz.
There's even things like "Pop For" and so on, too.
http://groups.google.com.au/groups?selm ... b08%40huey
> "Pop Gosub"??? first time fo me.
It exists; mainly in the very old languages, but it's even in Blitz.
There's even things like "Pop For" and so on, too.

http://groups.google.com.au/groups?selm ... b08%40huey