Discussions

SmileBASIC Community

Phoenix B)epicphoenix4

01/05/2016 3:31 PM ·Spoilers

Open Closed

DATA. How does it work?

I feel like I'm missing out on a big chunk of BASIC without knowing how to use DATA. So tell me what is it used for and how.

Advertisement

Comment

This post has no comments.

  • I'm stil new to smilebasic but I think I understand the data now what do you want to know?

    Yeahs1
    Played
  • DATA is used whan you have big amounts of data to store, in a linear way. first, place a goto label: @ANYTHING then you place DATA statements DATA 34, "Thomas", "Cake" DATA can have any amount of variables in one command then, to retrieve the data:

    Yeahs4
  • use RESTORE @ANYTHING then just a simple command to retrieve the data READ AGE, NAME$, FOOD$ when you use this with multiple DATAs, the read command automatically goes one data forward

    Yeahs3
  • so, if you want to store a map made out of tiles with IDs, use this code: DIM M(4,4) @MAP DATA 1,2,2,3 DATA 2,2,3,3 DATA 1,1,2,3 DATA 1,1,1,2 then RESTORE @MAP FOR I=0 TO 3 READ M(0,I), M(1,I), M(2,I), M(3,I) NEXT now you have converted the DATA block into an array

    Yeahs1
  • I'm a bit confused, but that helped ALOT. And you what they say don't learn to code, code to learn.

    Yeahs3
    Played
  • KNOW! know what they say.

    Yeahs3
    Played

Add a Comment

You must sign in to post a comment.

Sign in using a Nintendo Network ID to connect to users around the world by writing posts and comments and by giving Yeahs to other people's posts. You can create a Nintendo Network ID using your Wii U console or your system in the Nintendo 3DS family.

Use of Miiverse Details about Miiverse

Report Violation to Miiverse Administrators

You are about to report a post with content which violates the Miiverse Code of Conduct. This report will be sent to Nintendo's Miiverse administrators and not to the creator of the post.

Violation Type:

Post ID: 3DB-NBL7-BXM-ZM97-AND-K8JZ

Report Violation to Miiverse Administrators

You cannot report posts made automatically by a software title.

Edit Post

Select an action: