Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Text Adventure!
Maybe we won't. With all this talk...
Screwing with your reality since 1998.
Reply
The only thing stopping me is your style. So, I'm sorry but until I start seeing more examples I probably can't do much.
Not yet Snake! It's not over yet!
Reply
FreeBasic Wiki. Search for SUB/END SUB.
Screwing with your reality since 1998.
Reply
Hmmm... that's not my style. It was just an open-ended example. It should be pretty easy to figure out.
Reply
I don't want to sound like I'm making excuses to put this off, but because I'm nearing finals in college I've had lots of work dumped on me for the past few weeks. I'll probably be very busy for the next few weeks, so if you guys could get a start on it I could catch up later.
Not yet Snake! It's not over yet!
Reply
Quote:Are we still talking FB? I thought all variables in FB were Global. I hate to go back in the reverse direction, but everything your telling me can just as easily be done with GOSUBS and you wouldn't have to redeclare variables. I'm simply not seeing the point.

Going back a few posts you said you can make an objects function and a parsing function, etc...Why wouldn't you be able to do the same with Gosubs? Assuming you make all variables Global, you wouldn't even have to send the variables.

I'd recommend not using gosubs at all. Because everything you can do with gosubs you can do better and more efficiently with subroutines and functions. It's the opposite of what you may think: subs and functions are the easier way. Redeclaring variables is more of an advantage than a hinderence. Actually, you aren't "redeclaring" variables. You are creating new ones. They may have the same name as another, but they are separate because of their scope. Their scope is what gives you the advantage. It allows you to contain variables only within the areas of the program where they'll be used. It allows for better security and organization.

Making everything global will eat up your memory fast. Also, declaring variables outside the only method that will be using it can easily lead to spaghetti code. It will be more difficult to keep track of your variables and you may run into variable-naming conflicts. Some variables are best to be declared global, but only qualified ones should be (like ones that will be accessed frequently by many subs/functions, constants, etc.). Also, gosubs don't return values, so if you wanted to code a function as a gosub then you'd have to declare a new variable whose only purpose is to just return a result.
Reply
Slow down...people still use GoSubs??? :o
url=http://www.sloganizer.net/en/][Image: style4,TheDarkJay.png][/url]
Reply
Yep, I do.
Not yet Snake! It's not over yet!
Reply
Quote:Slow down...people still use GoSubs??? :o
I pity the fool who was never taught the new age of structured programming and shared variables. I know I use to use GOSUB's but once I learned how to use SUB/FUNCTION's, my world changed for the better.
Reply
What's the difference between a GOSUB and a CALL SUB(), anyway?

Quote:every one who helps will be the personaility behind one of the characters.
Ahh... yes... Can I be the penguins?
In the beginning, there is darkness – the emptiness of a matrix waiting for the light. Then a single photon flares into existence. Then another. Soon, thousands more. Optronic pathways connect, subroutines emerge from the chaos, and a holographic consciousness is born." -The Doctor
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)