Author Topic: SetUpVar  (Read 1693 times)

0 Members and 1 Guest are viewing this topic.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
SetUpVar
« on: April 25, 2012, 08:58:09 pm »
SetUpEditor is one of the most useful commands to BASIC programmers and I have always griped that I could not use it for other variable types like strings and matrices. Guess what I did?

What does it do?
Like the SetUpEditor does for lists, this will check for variables. If the variable doesn't exist, it gets created, or if it is archived, it gets unarchived.

How do I use it?
The line directly after calling this program contains a string of variables. The variable types that work are:
-Strings
-Pictures
-Equations
-Programs
-Matrices
So in practice, what you would do:
Code: [Select]
:Asm(prgmSETUPVAR
:[B],prgmALPHA,Pic2,Pic3,Str1,Str7,[C]
:<<rest of code>>

Notes:
Size? 208 bytes
This will try to work for other variables, but it will fail most likely and it will make you lose RAM and crash.

Offline jsj795

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1105
  • Rating: +84/-3
    • View Profile
Re: SetUpVar
« Reply #1 on: April 25, 2012, 09:07:29 pm »
Wow I'm so tempted to use this in my game, but then it would mean my game would be considered more as ASM/BASIC hybrid than pure BASIC :( but for other projects this would be immensely useful!
« Last Edit: April 25, 2012, 09:07:41 pm by jsj795 »


Spoiler For funny life mathematics:
1. ROMANCE MATHEMATICS
Smart man + smart woman = romance
Smart man + dumb woman = affair
Dumb man + smart woman = marriage
Dumb man + dumb woman = pregnancy
2. OFFICE ARITHMETIC
Smart boss + smart employee = profit
Smart boss + dumb employee = production
Dumb boss + smart employee = promotion
Dumb boss + dumb employee = overtime
3. SHOPPING MATH
A man will pay $2 for a $1 item he needs.
A woman will pay $1 for a $2 item that she doesn't need.
4. GENERAL EQUATIONS & STATISTICS
A woman worries about the future until she gets a husband.
A man never worries about the future until he gets a wife.
A successful man is one who makes more money than his wife can spend.
A successful woman is one who can find such a man.
5. HAPPINESS
To be happy with a man, you must understand him a lot and love him a little.
To be happy with a woman, you must love her a lot and not try to understand her at all.
6. LONGEVITY
Married men live longer than single men do, but married men are a lot more willing to die.
7. PROPENSITY TO CHANGE
A woman marries a man expecting he will change, but he doesn't.
A man marries a woman expecting that she won't change, and she does.
8. DISCUSSION TECHNIQUE
A woman has the last word in any argument.
Anything a man says after that is the beginning of a new argument.

Girls = Time * Money (Girls are a combination of time and money)
Time = Money (Time is money)
Girls = Money squared (So, girls are money squared)
Money = sqrt(Evil) (Money is also the root of all evil)
Girls = sqrt(Evil) squared (So, girls are the root of all evil squared)
Girls = Evil (Thus, girls are evil)
*Girls=Evil credit goes to Compynerd255*

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: SetUpVar
« Reply #2 on: April 25, 2012, 09:26:28 pm »
Hehe, thanks :3 I threw this one together today after getting the idea over on TIBasicDev. I was talking about how awesome SetUpEditor is when I decided to finally make this. :)