Author Topic: Need help  (Read 5864 times)

0 Members and 1 Guest are viewing this topic.

Offline joao9856

  • LV3 Member (Next: 100)
  • ***
  • Posts: 73
  • Rating: +3/-0
    • View Profile
Need help
« on: January 24, 2013, 09:43:31 am »
Is it possible to call a program from inside another program?

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: Need help
« Reply #1 on: January 24, 2013, 09:51:58 am »
It is in TI Basic

Under the prgm menu, go to the exec tab and directly enter the program you want to call on it's own line in the editor.

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Offline joao9856

  • LV3 Member (Next: 100)
  • ***
  • Posts: 73
  • Rating: +3/-0
    • View Profile
Re: Need help
« Reply #2 on: January 24, 2013, 10:08:03 am »
i can't find that. Also important info i'm using Ti-Nspire

Offline ElementCoder

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 611
  • Rating: +42/-2
    • View Profile
Re: Need help
« Reply #3 on: January 24, 2013, 10:10:38 am »
Well than you can't find that indeed :P Homer gave instructions for the TI84 series (which is assumed if you say "TI BASIC"). For Nspire, you just call a program by typing its name. example:
Code: [Select]
Define example()=
Prgm
anotherprogram()
EndPrgm

Some people need a high five in the face... with a chair.
~EC

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: Need help
« Reply #4 on: January 24, 2013, 10:34:19 am »
i can't find that. Also important info i'm using Ti-Nspire

Whoops, my bad. I assumed the 83/84 due to the forum category :P

(Now that I think about it, do we have a separate forum for Nspire-Basic?)

ElementCoder gave the method for the Nspire. However, if I remember correctly subroutines called in a program must be defined elsewhere in the same document. I think there's a way to make it so you'll only need to define a program once and not everytime you use a new document, but it's been a while since I've done anything with the Nspire. <.<
« Last Edit: January 24, 2013, 10:35:13 am by HOMER-16 »

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Offline joao9856

  • LV3 Member (Next: 100)
  • ***
  • Posts: 73
  • Rating: +3/-0
    • View Profile
Re: Need help
« Reply #5 on: January 24, 2013, 10:34:53 am »
i called a program in an if statement and it does not save the variables

Code: [Select]
define example()
requeststr"a b c",choose,0
if choose="b" then
bcode()
text"its b"

its something like that what i've created

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: Need help
« Reply #6 on: January 24, 2013, 10:39:30 am »
Choose may be a local variable in the parent program, and thus bcode() doesn't know about it.

You could have choose as a global variable or pass in an argument to bcode()

Code: [Select]
define example()
requeststr"a b c",choose,0
if choose="b" then
bcode(choose)
text"its b"

Like so.

Edit: bcode() would look like

Code: [Select]
define bcode(choose)
« Last Edit: January 24, 2013, 10:41:08 am by HOMER-16 »

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Offline joao9856

  • LV3 Member (Next: 100)
  • ***
  • Posts: 73
  • Rating: +3/-0
    • View Profile
Re: Need help
« Reply #7 on: January 24, 2013, 10:49:22 am »
got it i didn't need to change anything but thanks.
next time i should remember to save all programs. :crazy:
What happened was that i was building a program and saved it so i could see its working, but i forgot to save the "bcode program", so i was trying to runa program that was not there.
« Last Edit: January 24, 2013, 10:50:48 am by joao9856 »

Offline ElementCoder

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 611
  • Rating: +42/-2
    • View Profile
Re: Need help
« Reply #8 on: January 24, 2013, 10:53:01 am »
...I think there's a way to make it so you'll only need to define a program once and not everytime you use a new document...
There is, you'd have to make your program LibPriv or LibPub. LibPub will make it show up in the catalog, LibPriv means it won't. This can be set in the program editor by going to menu>1: Actions>7: Change Library Acces. You'd then access it by calling <libraryname>\function()

Yeah running a program that isn't there won't do much :P though that should have given you an error "Function not defined" (or you must mean you gave it no body).
« Last Edit: January 24, 2013, 10:54:12 am by ElementCoder »

Some people need a high five in the face... with a chair.
~EC

Offline joao9856

  • LV3 Member (Next: 100)
  • ***
  • Posts: 73
  • Rating: +3/-0
    • View Profile
Re: Need help
« Reply #9 on: January 24, 2013, 10:55:45 am »
probably only saved it while it was clean

Offline ElementCoder

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 611
  • Rating: +42/-2
    • View Profile
Re: Need help
« Reply #10 on: January 24, 2013, 10:57:30 am »
I have just decided to pick up my "book-that-never-came-further-than-title-page" about Nspire BASIC, I should have a chapter or two done by the end of the week, though that probably won't be of help for you, Ch.1 will be about the editor and it's functionality and Ch.2 will be the hello world :)

Some people need a high five in the face... with a chair.
~EC

Offline joao9856

  • LV3 Member (Next: 100)
  • ***
  • Posts: 73
  • Rating: +3/-0
    • View Profile
Re: Need help
« Reply #11 on: January 24, 2013, 11:00:14 am »
I think i wont be learning much, but i never know specialy because i only code in ti-nspire with simple tasks, that is before my current project.(trying a menu only rpg with level system :hyper:)
« Last Edit: January 24, 2013, 11:00:34 am by joao9856 »

Offline ElementCoder

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 611
  • Rating: +42/-2
    • View Profile
Re: Need help
« Reply #12 on: January 24, 2013, 11:02:25 am »
If you want to make an RPG you should most definitely look at TI RPG and TI RPG 2 both by Superbany, especially the latter is extremely well made.

Some people need a high five in the face... with a chair.
~EC

Offline joao9856

  • LV3 Member (Next: 100)
  • ***
  • Posts: 73
  • Rating: +3/-0
    • View Profile
Re: Need help
« Reply #13 on: January 24, 2013, 11:04:01 am »
thanks for the help!

Offline joao9856

  • LV3 Member (Next: 100)
  • ***
  • Posts: 73
  • Rating: +3/-0
    • View Profile
Re: Need help
« Reply #14 on: January 25, 2013, 09:56:08 am »
New question, is there anyway of puting a variable inside a requeststr like this:
Code: [Select]
request "I have x peanuts and you?",peanuts,0
Edit:another Question

How can i from a number like 9.57 turn into 9?
if you didn't understand please say it.
« Last Edit: January 25, 2013, 10:51:49 am by joao9856 »