ID:103357
 
I never thought I'd see the day when I would actually find a need for 'goto,' but that day has come for the first time after 7 years of programming in a few different languages.

Recently, I was contracted by a user of the name Flame Sage to create a fully functional textbox system (complete with menus and whatnot) for his DW3 project. I was going right along and found a point where it became proper to create a function to back out of a textbox. I finished this and tried it out when I realized that I totally screwed up. Previously, I had a logic flow like this:

Create menu
When ready:
Create another menu
... do more stuff


Well, when someone backs out of a menu it just keeps trying to go on and I hadn't even thought about that. After much thought about the problem and trying to find alternatives, I have yet to think of a proper alternative to my problem of needing to take a few steps back in the logic. The nested dialogs get so complicated that a while() loop starting AFTER each box is created and before I do the proper stuff to wait until it's ready would get so confusing that it's not even funny.

I just ran into this about ten minutes ago. My mind is still blown.
OK?
Static-GT wrote:
OK?

It's something interesting, is all.

I guess you've blown more minds than your own with this. Hi5.
If something is there, there's a reason for it. Even so, that's pretty crazy that you've only ever found one use for a verb(is it a verb? Sorry I can't program).
It's an instruction telling the VM to take a jump to another section of the code. In this case, when a menu gets backed out of I have to reverse everything that happened and back out to the previous menu. It's a logical jump, and re-creating the menus as in starting the process over again and going back to the previous menu makes no sense.
Could you show us the code for this? I'd like to dispute your use of it =D.
DivineTraveller wrote:
Static-GT wrote:
OK?

It's something interesting, is all.

I guess you've blown more minds than your own with this. Hi5.



Hai Fyv! :D
Stephen001 wrote:
Could you show us the code for this? I'd like to dispute your use of it =D.

lol. Next time you're in Chat we can discuss it.
OK