トピック
zag Tall-T

What is DATA used for? And how do I use it?

2そうだね
未プレイ
返信[1]
親投稿
raimondz raimondxz
DATA is a way to store values in a queue. Then you can read those values using READ or RESTORE if the data was defined after a label. DATA is useful if you don't want to hard code everything in your code. For example, I used data on the program I posted bellow to define attack patterns and other stuff. https://miiverse.nintendo.net/posts/AYMHAAACAAADVHknZvDpag
0そうだね
プレイ済み
返信[2]
親投稿
OlOOlOOl pi_r_round
DATA holds a series of constants which can be obtained using the READ command. DATA "fishes",12 DATA "cats",2 DATA "dogs",3 FOR I=1 to 3 READ ANIMAL$ READ COUNT PRINT "animal: ";ANIMAL$;", qty:";COUNT NEXT Each constant is read, one after the other. You can use the RESTORE command to make it start over from the first one again.
2そうだね
プレイ済み
返信[3]
親投稿
zag Tall-T
Waw that is quite useful to me...but how do you make it print sumthing?
0そうだね
未プレイ
返信[4]
親投稿
OlOOlOOl pi_r_round
Use the PRINT command. PRINT A$ The above will print the contents of A$ onto the active display. PRINT B The above will print the value of B onto the active display.
1そうだね
プレイ済み
返信[5]
親投稿
zag Tall-T
Okay..but what does data 1 mean?
0そうだね
未プレイ
返信[6]
親投稿
zag Tall-T
I know a lot of code but not data.
0そうだね
未プレイ
返信[7]
親投稿
OlOOlOOl pi_r_round
The SmileBASIC command list along with examples how to use each command, is available on their web site. It's worthwhile downloading it onto your PC or tablet, and reading through it, to see what built-in commands are available and what they do.
0そうだね
プレイ済み
返信[8]
親投稿
zag Tall-T
It only comes in Japan though :c
0そうだね
未プレイ
返信[9]
親投稿
OlOOlOOl pi_r_round
DATA 1 The above means that after the below command is executed, the variable A will contain the value 1. READ A
1そうだね
プレイ済み
返信[10]
親投稿
OlOOlOOl pi_r_round
The English-language site is up, and the documents are there in English.
1そうだね
プレイ済み
返信[11]
親投稿
zag Tall-T
So the smile basic app is in English now?
0そうだね
未プレイ
返信[12]
親投稿
OlOOlOOl pi_r_round
smilebasic.com/en/ that's the English-language site
0そうだね
プレイ済み
返信[13]
親投稿
OlOOlOOl pi_r_round
The English-language version of SmileBASIC is available from the North American Nintendo e-shop.
1そうだね
プレイ済み
返信[14]
親投稿
zag Tall-T
Yeah I have it. And I got the instructions list!
0そうだね
未プレイ
返信[15]
親投稿
zag Tall-T
How do I scroll my print?
0そうだね
未プレイ
返信[16]
親投稿
OlOOlOOl pi_r_round
Do you mean - make it go up the screen, so there'll be room below it, for the next line? Just print something else. The new text will appear below the old. When the last row of the display is reached, all the old text will automatically shift up to make room for the new.
0そうだね
プレイ済み
返信[17]
親投稿
zag Tall-T
Oh sorry...
0そうだね
未プレイ
返信[18]
親投稿
zag Tall-T
How do I move a sprite to a specific place and stop then move again?
0そうだね
未プレイ
返信[19]
親投稿
zag Tall-T
Etc
0そうだね
未プレイ
返信[20]
親投稿
OlOOlOOl pi_r_round
Use the "XY" feature of the SPANIM command. Sorry, I don't have an example at hand at the moment. It'll be about 12 hours before I can get back on MiiVerse. If you open a new discussion for this latest question, others will see it and reply sooner than I can.
1そうだね
プレイ済み