I'm relatively new and need some help with a part of my program that I've been struggling with.

Basically, I'm trying to have somebody input their name, which is then stored to the variable namevar. I need to then store the string that's stored to namevar to a list, which I've done relatively easily. However, I then need to name a matrix after the value, but can't seem to figure out how to do that. Any suggestions? I'm using a V200

Edit: Got it working, thanks to Xeda! Here's my code:


Code:
Dialog
 Request "namevar",namevar
EndDlog
[[1,1],[1,1]]→#namevar
You can't do it in pure 68k basic.

Edit: Looks like I was mistaken.
I was pretty sure that indirection can be used, like:

Code:
"mat0"→namevar
[[0,0][0,0]]→#(namevar)

You would need to use parentheses. I feel like I did something like this when I made a sprite editor so that users could name them.

edit: fixed code syntax and provided a better example.
mr womp womp wrote:
You can't do it in pure 68k basic.
Darn, okay. In that case, do you know any way that I could name save files?
Xeda112358 wrote:
I was pretty sure that indirection can be used, like:

Code:
{{0,0},{0,0}}->#(namevar)

You would need to use parentheses. I feel like I did something like this when I made a sprite editor so that users could name them.

No, the parentheses are just removed during tokenization, so I figure they aren't important.
Oh, btw, you can edit your posts, instead of double posting. Based in the discord chat, I should have specified, indirection takes a string as an argument. (And I did finally find my 89)
  
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 1
» 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