Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / How To Declare Local Variables When Using: "#option_explicit"?

Author
Message
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 3rd May 2017 04:36 Edited at: 3rd May 2017 04:37
Hi,

Making great progress...
Someone said add: "#option_explicit" to the top of our main.agc.
We did that now and now all of our local variables are coming up with error "has not been defined"?

How do we declare local "throw away" variables in AppGameKit's BASIC language?
Thanks!
JeZxLee
16BitSoft Inc.
Video Game Design Studio
http://www.16BitSoft.com
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 3rd May 2017 04:53
If you declare a variable in a function it will be deleted at the end of the function.
you can declare variable like so


JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 3rd May 2017 05:05
Got it, thanks again!
Going to collapse on floor now and sleep...more coming tomorrow!
JeZxLee
16BitSoft Inc.
Video Game Design Studio
http://www.16BitSoft.com
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 5th May 2017 20:34
Put the word local in front of the variable name

The coffee is lovely dark and deep,and I have code to write before I sleep.

Login to post a reply

Server time is: 2024-11-22 03:08:57
Your offset time is: 2024-11-22 03:08:57