Author Topic: Undocumented TI-BASIC tricks  (Read 84166 times)

0 Members and 4 Guests are viewing this topic.

Offline kalan_vod

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2715
  • Rating: +10/-0
    • View Profile
    • kalanrock.us
Undocumented TI-BASIC tricks
« Reply #90 on: January 04, 2006, 04:27:00 pm »
QuoteBegin-necro+4 January 2006, 22:21-->
QUOTE (necro @ 4 January 2006, 22:21)
yes, you unrapped a line break and as such, "not(...:not(..." is better than an "not(Ans:"...if I had a third line of conditionals in there, it would be better my way though  

 But there is a problem with both of ours, when you run it if xlib isn't installed then it says "Install Xlib!" but now the Ans is "Install Xlib!" so it receives a DATA TYPE error. So in order to stop that just place the first1 in a If Then
c1
-->
CODE
ec11
real(0
If not(Ans:Then
Pause "Install Xlib!
Return
Endc2
ec2
Then just place the rest of the code after End (The rest of the program).

Offline necro

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1295
  • Rating: +17/-2
  • +3 vaporal mustache
    • View Profile
Undocumented TI-BASIC tricks
« Reply #91 on: January 04, 2006, 04:58:00 pm »
Indeed...but what about the whole Kitten-kaboodale (sp?)

:1
:real(0
:If not(Ans
:Then
:ClrHome
:Disp "PLEASE INSTAL XLIB BEFORE TRYING TO RUN THIS GAME
:Pause
:End
:If not(Ans
:Stop  
I'm like a woot burger with awesome fries


VB.Net, C#, C++, Java, Game Maker

Offline kalan_vod

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2715
  • Rating: +10/-0
    • View Profile
    • kalanrock.us
Undocumented TI-BASIC tricks
« Reply #92 on: January 04, 2006, 05:51:00 pm »
QuoteBegin-necro+4 January 2006, 22:58-->
QUOTE (necro @ 4 January 2006, 22:58)
Indeed...but what about the whole Kitten-kaboodale (sp?)

:1
:real(0
:If not(Ans
:Then
:ClrHome
:Disp "PLEASE INSTAL XLIB BEFORE TRYING TO RUN THIS GAME
:Pause
:End
:If not(Ans
:Stop

One thing disp doesn't wrap :Pblah.gif.

c1
-->
CODE
ec1:1
:real(0
:If not(Ans
:Then
:ClrHome
:Output(1,1,"PLEASE INSTAL XLIB BEFORE TRYING TO RUN THIS GAME
:Pause
:stop
:Endc2
ec2

dysfunction

  • Guest
Undocumented TI-BASIC tricks
« Reply #93 on: January 05, 2006, 07:39:00 am »
Also, you misspelled Install.

dragon__lance

  • Guest
Undocumented TI-BASIC tricks
« Reply #94 on: January 06, 2006, 05:43:00 pm »
that's nice to know, Tr1pl1ea should include that peice of code in the readme so all games with xlib uses it :)smile.gif

Offline kalan_vod

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2715
  • Rating: +10/-0
    • View Profile
    • kalanrock.us
Undocumented TI-BASIC tricks
« Reply #95 on: January 06, 2006, 05:47:00 pm »
QuoteBegin-dragon__lance+6 January 2006, 23:43-->
QUOTE (dragon__lance @ 6 January 2006, 23:43)
that's nice to know, Tr1pl1ea should include that peice of code in the readme so all games with xlib uses it :)smile.gif

 Well if xlib gets turned into a basic xlib game app it will not need the code above.

Offline necro

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1295
  • Rating: +17/-2
  • +3 vaporal mustache
    • View Profile
Undocumented TI-BASIC tricks
« Reply #96 on: January 06, 2006, 05:59:00 pm »
I guess that is a vote for my proposal of making an xlib shell?
I'm like a woot burger with awesome fries


VB.Net, C#, C++, Java, Game Maker

Offline kalan_vod

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2715
  • Rating: +10/-0
    • View Profile
    • kalanrock.us
Undocumented TI-BASIC tricks
« Reply #97 on: January 06, 2006, 06:26:00 pm »
QuoteBegin-necro+6 January 2006, 23:59-->
QUOTE (necro @ 6 January 2006, 23:59)
I guess that is a vote for my proposal of making an xlib shell?  

 Oh well I have been for it just didn't want Pat getting tired of working on it.

dysfunction

  • Guest
Undocumented TI-BASIC tricks
« Reply #98 on: January 12, 2006, 03:52:00 pm »
Apparently expr( doesn't work with the Goto command either, that's a shame.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Undocumented TI-BASIC tricks
« Reply #99 on: January 12, 2006, 04:17:00 pm »
too bad :(sad.gif

at least does it work with useful commands?

dysfunction

  • Guest
Undocumented TI-BASIC tricks
« Reply #100 on: January 12, 2006, 04:22:00 pm »
It does work with many useful commands.

On a slightly different topic, does anyone know a way in which I can jump to a section of program according to the number stored in a variable? Say variable A=5, is there a way to then Goto 5, or Goto 27 if A=27, etc?

Offline kalan_vod

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2715
  • Rating: +10/-0
    • View Profile
    • kalanrock.us
Undocumented TI-BASIC tricks
« Reply #101 on: January 12, 2006, 05:05:00 pm »
No but you could do

c1-->
CODE
ec1A
If Ans=1:Goto 1
If Ans=2:Goto 2
If Ans=3:Goto 3
....
etcc2
ec2

Offline tifreak

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2708
  • Rating: +82/-3
  • My Kung Fu IS strong...
    • View Profile
    • TI-Freakware
Undocumented TI-BASIC tricks
« Reply #102 on: January 12, 2006, 05:09:00 pm »
Depends on what you are doing, but you can use While statments like goto/lbl commands, by manipulating the variable values... :)smile.gif

Just keep everything in one big loop, say like this:

While W>0
All your fancy While commands go here
End
Return

And if you want out of the loops, just delvar W... :)smile.gif

Make sense?
Projects: AOD Series: 75% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Offline kalan_vod

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2715
  • Rating: +10/-0
    • View Profile
    • kalanrock.us
Undocumented TI-BASIC tricks
« Reply #103 on: January 12, 2006, 06:24:00 pm »
QuoteBegin-tifreak8x+12 January 2006, 23:09-->
QUOTE (tifreak8x @ 12 January 2006, 23:09)
Depends on what you are doing, but you can use While statments like goto/lbl commands, by manipulating the variable values... :)smile.gif

Just keep everything in one big loop, say like this:

While W>0
All your fancy While commands go here
End
Return

And if you want out of the loops, just delvar W... :)smile.gif

Make sense?  

 Yeah and no memory leaks :Pblah.gif.

CDI

  • Guest
Undocumented TI-BASIC tricks
« Reply #104 on: January 13, 2006, 12:04:00 am »
my 2 cents...

int(log(#)+1 = How many digits the number is

example

Text(0,0,sub(" 00000000",1,8-int(log(S)+1)),S

will return an 8 digit number at 0,0 on the GS no matter what (if S's digits are less than 8)