Page 2 of 2
Posted: Tue Jan 22, 2008 12:25 am
by Dare
Demivec wrote:On a side note, I'm interrested in a "On <indexvalue> ExecProc" kind of command as well. It would be used instead of the Select/Case. I think it has merits for speed and ease of reading. But that's another story.
Agreed!
I currently use an array of addresses and CallFunctionFast for a similar result. Nice to have this as native! But, as you say, another story.
Posted: Tue Jan 22, 2008 12:08 pm
by Psychophanta
Posted: Tue Jan 22, 2008 12:25 pm
by Tranquil
The commands Goto, Gosub & Return are still present in PB? Never noticed that...

Posted: Thu Jan 24, 2008 2:21 am
by DoubleDutch
Posted: Tue Mar 24, 2009 3:13 pm
by mesozorn
In VB, you can easily do:
Code: Select all
Public Sub Test()
a = 20
GoSub Whatever
Exit Sub
Whatever:
MsgBox "Value is " + Str(a)
Return
End Sub
...without messing up the stack or causing any problems whatsoever. It should be just as simple to do this in PB.
Posted: Tue Mar 24, 2009 3:41 pm
by Fluid Byte
Gravedigger?
[edit]
OMG, he even raped a second thread with the same response ...
http://www.purebasic.fr/english/viewtopic.php?t=30736
Posted: Tue Mar 24, 2009 3:54 pm
by mesozorn
Fluid Byte wrote:OMG, he even raped a second thread with the same response ...
Sorry, I got confused thinking they were different pages of the same thread, and that my response hadn't been posted on the first try, so I tried again. Didn't realize it was a repeat post.
Posted: Tue Mar 24, 2009 4:11 pm
by Kaeru Gaman
point is
freak wrote:Gosub adjusts the stack, Goto doesn't. Thats why you can use the one inside procedures and not the other.
so, absolutely meaningless what VisualBasic does or doesn't or fry some dingo's kidneys on a hot tin roof....
it would not be "simple" to allow Gosub in a Procedure, but would need a whole bloody lot of altering the handling away from how it is now.
... and that for some ... useless (?) ... feature?
c'mon....
Posted: Tue Mar 24, 2009 7:22 pm
by Kale
netmaestro wrote:I don't believe either one belongs in a modern variant of the Basic language. There's far more power in PB today than was ever in early Basic's, so much in fact that using primitive commands like these is not only pointless but it leads to seriously bad programming styles.
+11
Edsger W.Dijkstra wrote:The unbridled use of the go to statement has as an immediate consequence that it becomes terribly hard to find a meaningful set of coordinates in which to describe the process progress.
Edsger W.Dijkstra wrote:The go to statement as it stands is just too primitive, it is too much an invitation to make a mess of one's program.
Don't use goto until you have learnt enough to know why using goto is bad, then hopefully you would have learn't never to use it!!!