Discussions

SmileBASIC Community

KennyKenny3DSXL

06/24/2016 11:04 PM ·Spoilers

Open Closed

Storing Data for Future Use

How do I store a variable's data for future use, such as a high score?

Advertisement

Comment

This post has no comments.

  • Use the SAVE command. You can save numerical arrays as DAT files by following this syntax... DIM SAVARR[1] 'DECLARE AN ARRAY WITH THE SIZE BEING THE NUMBER OF VARIABLES YOU WANT TO SAVE SAVARR[0]=HIGHSCORE 'PLACE ALL THE VARIABLES YOU WANT TO SAVE IN THE ARRAY SAVE "DAT:<File Name>",SAVARR 'YOU CAN THEN SAVE THE FILE WITH ANY NAME YOU WANT

    Yeahs0
    Played
  • Loading back the file is also very easy! You can use the LOAD command. It follows a very similar syntax... DIM LOADARR[0] 'AN ARRAY TO LOAD UP THE VARIABLES IN. YOU CAN SET THE SIZE AS 0 LOAD "DAT:<File Name>",LOADARR 'LOAD THE FILE BACK WITH THE SAME NAME YOU SAVED IT WITH HIGHSCORE=LOADARR[0] 'RETRIEVE ALL THE SAVED VARIABLES

    Yeahs0
    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-BXN-3HKR-CK2-32H7

Report Violation to Miiverse Administrators

You cannot report posts made automatically by a software title.

Edit Post

Select an action: