Author Topic: How do I store a string to to a program in AXE?  (Read 2612 times)

0 Members and 1 Guest are viewing this topic.

Offline spud2451

  • LV2 Member (Next: 40)
  • **
  • Posts: 39
  • Rating: +3/-3
  • Life is simple, but we make it complicated ~conf.
    • View Profile
    • Red Rock Creative [Free Custom Websites]
How do I store a string to to a program in AXE?
« on: May 24, 2014, 03:57:40 pm »
How do store a 0 terminated string to a program in AXE. I want to do this because I'm making the libraries for fiddle 3.0 and need to be able to run user inputted code. I'm currently thinking that all I have to do is store the code to a program then run the program. That's what I did for fiddle 2.0 and 2.5 so it should work in a similar setting.
I currently have this code:
Code: [Select]
INPUT() -> A #this is a self written input routine
GetCalc("prgmTEMP",{A-2}r) -> B
Copy(A,B,{A-2}r)
With this code it creates the program "TEMP" but then just write a whole bunch of question marks and jibberish.
Does anyone know what im doing wrong here?

Offline ClrDraw

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 627
  • Rating: +61/-2
    • View Profile
    • GitHub
Re: How do I store a string to to a program in AXE?
« Reply #1 on: May 24, 2014, 04:08:41 pm »
Are you sure its even being stored into A? You should store it into L1 instead.
Visit my GitHub for all my TI programs as well as other projects.
Also check out my website.

Offline spud2451

  • LV2 Member (Next: 40)
  • **
  • Posts: 39
  • Rating: +3/-3
  • Life is simple, but we make it complicated ~conf.
    • View Profile
    • Red Rock Creative [Free Custom Websites]
Re: How do I store a string to to a program in AXE?
« Reply #2 on: May 24, 2014, 04:09:33 pm »
Why L1?

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: How do I store a string to to a program in AXE?
« Reply #3 on: May 24, 2014, 04:09:41 pm »
Well, this code should work so long as {A-2}^^r holds the size of the data to copy. Keep in mind you have to use tokens and not characters for programs.

Also ClrDraw : A just holds a pointer here. ;)

Offline spud2451

  • LV2 Member (Next: 40)
  • **
  • Posts: 39
  • Rating: +3/-3
  • Life is simple, but we make it complicated ~conf.
    • View Profile
    • Red Rock Creative [Free Custom Websites]
Re: How do I store a string to to a program in AXE?
« Reply #4 on: May 24, 2014, 04:12:59 pm »
The tokens might be what I'm doing wrong. I think its just a normal string not a string of tokens Thanks!


EDIT:


Thanks that worked!
« Last Edit: May 24, 2014, 04:24:04 pm by spud2451 »