So I am trying to make a program that can make an appvar, and use it as a "storage" area for a game, the only issue is I can only get det(0) to work, and nothing to do with editing or reading the appvar itself, so any and all help is much appreciated. A working example program would be extremely helpful as I tend to learn faster with a visual example that I can edit to learn what I want.

Thanks ahead of time. Very Happy
Can you be any more specific about what fails? Can you show us some of the code you've written along with what it is supposed to do?
This is a program that will prompt you for a name and it will create an appvar with that name. It will also prompt you for your name, age, and address and save it into the appvar. Then it will display your name, age , and address.


Code:

Input "Name of appv:",Str1
det(0,5,"rowSwap("+Str1
Input "Your name:",Str2
det(6,"rowSwap("+Str1,Str2,1
Input "Your age:",Str2
det(6,"rowSwap("+Str1,Str2,2
Input "Your address:",Str2
det(6,"rowSwap("+Str1,Str2,3
ClrHome
Disp "Name is",det(5,"rowSwap("+Str1,1
Disp "Age is",det(5,"rowSwap("+Str1,2
Disp "Address is",det(5,"rowSwap("+Str1,3
Return

[/code]
If you want to be sure the thing that you're shoving into the appvar is a number, you could even do something like this:


Code:
:Input "Your age:",X
:det(6,"rowSwap("+Str1,det(1,X),2
Do I have to do something different if I wanted to store Variables, Lists, Matrices, and equations to it also?
Sonlen wrote:
Do I have to do something different if I wanted to store Variables, Lists, Matrices, and equations to it also?
Yes, you need to convert them each to a string. Simple real variables are just det(1,X). Complex variables would be det(1,real(X))+"+"+det(1,imag(X))+"i", for instance. Lists, matrices, and equations could be similarly packed.
KermMartian wrote:
Sonlen wrote:
Do I have to do something different if I wanted to store Variables, Lists, Matrices, and equations to it also?
Yes, you need to convert them each to a string. Simple real variables are just det(1,X). Complex variables would be det(1,real(X))+"+"+det(1,imag(X))+"i", for instance. Lists, matrices, and equations could be similarly packed.


I was guessing I would have to turn them into a string, but could you explain that in, oh 5th grade english so there is not a doubt I won't understand any of it?
Sonlen wrote:
KermMartian wrote:
Sonlen wrote:
Do I have to do something different if I wanted to store Variables, Lists, Matrices, and equations to it also?
Yes, you need to convert them each to a string. Simple real variables are just det(1,X). Complex variables would be det(1,real(X))+"+"+det(1,imag(X))+"i", for instance. Lists, matrices, and equations could be similarly packed.


I was guessing I would have to turn them into a string, but could you explain that in, oh 5th grade english so there is not a doubt I won't understand any of it?
Det(1,N) turns number N into a string. With string manipulation functions, especially concatenation, you can create string representations of data structures like lists and matrices very easily (judicious use of curly braces and commas for lists, and commas and square braces for matrices).
KermMartian wrote:
Sonlen wrote:
KermMartian wrote:
Sonlen wrote:
Do I have to do something different if I wanted to store Variables, Lists, Matrices, and equations to it also?
Yes, you need to convert them each to a string. Simple real variables are just det(1,X). Complex variables would be det(1,real(X))+"+"+det(1,imag(X))+"i", for instance. Lists, matrices, and equations could be similarly packed.


I was guessing I would have to turn them into a string, but could you explain that in, oh 5th grade english so there is not a doubt I won't understand any of it?
Det(1,N) turns number N into a string. With string manipulation functions, especially concatenation, you can create string representations of data structures like lists and matrices very easily (judicious use of curly braces and commas for lists, and commas and square braces for matrices).


So if I am reading this right, all I have to do is replace N with whatever I want to store to it correct?

Like det(1,{1,2,3,4}) and it would store it as a string?
No, det(1,) converts only numbers into strings. It does not convert lists or matrices, but you can use this command to convert lists and matrices too using loops and string manipulation.
souvik1997 wrote:
No, det(1,) converts only numbers into strings. It does not convert lists or matrices, but you can use this command to convert lists and matrices too using loops and string manipulation.


Is there a way I can just add the quotes on the outside of it all so that it is a string, then remove those somehow to make it back into a matrix or list? Otherwise I will get it figured out. Very Happy
Sonlen wrote:
souvik1997 wrote:
No, det(1,) converts only numbers into strings. It does not convert lists or matrices, but you can use this command to convert lists and matrices too using loops and string manipulation.


Is there a way I can just add the quotes on the outside of it all so that it is a string, then remove those somehow to make it back into a matrix or list? Otherwise I will get it figured out. Very Happy


No, that is not possible.
souvik1997 wrote:
Sonlen wrote:
souvik1997 wrote:
No, det(1,) converts only numbers into strings. It does not convert lists or matrices, but you can use this command to convert lists and matrices too using loops and string manipulation.


Is there a way I can just add the quotes on the outside of it all so that it is a string, then remove those somehow to make it back into a matrix or list? Otherwise I will get it figured out. Very Happy


No, that is not possible.


Thanks for the clarification. Very Happy
souvik1997 wrote:
Sonlen wrote:
souvik1997 wrote:
No, det(1,) converts only numbers into strings. It does not convert lists or matrices, but you can use this command to convert lists and matrices too using loops and string manipulation.


Is there a way I can just add the quotes on the outside of it all so that it is a string, then remove those somehow to make it back into a matrix or list? Otherwise I will get it figured out. Very Happy


No, that is not possible.
What about expr()? I think you could probably pull that off, for example:

expr("[[0,1,2][3,4,5]]")->[A]
KermMartian wrote:
souvik1997 wrote:
Sonlen wrote:
souvik1997 wrote:
No, det(1,) converts only numbers into strings. It does not convert lists or matrices, but you can use this command to convert lists and matrices too using loops and string manipulation.


Is there a way I can just add the quotes on the outside of it all so that it is a string, then remove those somehow to make it back into a matrix or list? Otherwise I will get it figured out. Very Happy


No, that is not possible.
What about expr()? I think you could probably pull that off, for example:

expr("[[0,1,2][3,4,5]]")->[A]


Hmmm... I will try that out right now to see what I get.

Works perfectly, even when stored to a string, and with lists too, thanks, I completely forgot about that possibility. Very Happy
Huzzah! Glad I was able to help; I hoped that was what you were talking about. Smile What are the next steps of progression looking like for this, then?
KermMartian wrote:
Huzzah! Glad I was able to help; I hoped that was what you were talking about. Smile What are the next steps of progression looking like for this, then?


Hopefully when I get all the data for the game in place, including everything needed for the characters, maps, everything needed for enemies, and the GUI system finished.
Sonlen wrote:
KermMartian wrote:
Huzzah! Glad I was able to help; I hoped that was what you were talking about. Smile What are the next steps of progression looking like for this, then?


Hopefully when I get all the data for the game in place, including everything needed for the characters, maps, everything needed for enemies, and the GUI system finished.
Are you working on the latter and former halves of those sentences simultaneously or sequentially? When can we look forward to more eye-candy screenshots from you?
KermMartian wrote:
Sonlen wrote:
KermMartian wrote:
Huzzah! Glad I was able to help; I hoped that was what you were talking about. Smile What are the next steps of progression looking like for this, then?


Hopefully when I get all the data for the game in place, including everything needed for the characters, maps, everything needed for enemies, and the GUI system finished.
Are you working on the latter and former halves of those sentences simultaneously or sequentially? When can we look forward to more eye-candy screenshots from you?


As soon as I can get this exp bar working and get it to change data based on the character selected, I plan to get a non-broken release of wabbit emu and show my progress on the pause menu and status screen.
That sounds like a plan. I can send you a non-broken WabbitEmu release, and I hope we can help you figure out the experience bar problems. Please feel free to bump/repost if you're still having problems with that.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 3
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement