Share via

Encode & Decode with Small Basic (Onedrive)

GohJiayi 106 Reputation points
2022-01-17T03:07:19.857+00:00

I'm here!

Can Small-Basic read/write to cloud storage (for example, OneDrive) without requiring data to be synced locally?

HighScore = File.ReadLine("C:\Users\trevo\OneDrive\Folder\HighScore.txt",1)
If score > HighScore Then
GraphicsWindow.ShowMessage( "Game Over. You have beaten the current high score: " + HighScore + ".", "Title" )
File.WriteLine("C:\Users\trevo\OneDrive\Folder\HighScore.txt",1,score)
Else
GraphicsWindow.ShowMessage( "Game Over.", "Title" )
EndIf

When the filepath/name is replaced with the OneDrive edit link (a URL that begins with "https://1drv.ms/"), the application continues to run but no data is read or written, resulting in a new top score for each game!

Microsoft 365 and Office | OneDrive | For business | Windows
0 comments No comments

Answer accepted by question author

Meng Yang Liu 911 Reputation points
2022-01-17T16:18:42.633+00:00

Lol I think I understand what you are trying to ask,

Just a kind reminder for future reference, for similar subject matter you should use "small-basic"

as for the code try this:

score=2

HighScore = File.ReadLine("C:\Users\jrmrh\OneDrive\HighScore.txt",1)
If score > HighScore Then
GraphicsWindow.ShowMessage( "Game Over. You have beaten the current high score: " + HighScore + ".", "Title" )
File.WriteLine("C:\Users\jrmrh\OneDrive\HighScore.txt",1,score)
Else
GraphicsWindow.ShowMessage( "Game Over.", "Title" )
EndIf

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Emily Hua-MSFT 27,911 Reputation points
    2022-01-17T07:48:36.213+00:00

    Hi @GohJiayi

    Welcome to Q&A forum ~

    But the tag "office-onedrive-client-itpro" focus more on general issue of OneDrive client.
    As your issue is more related to OneDrive development, I would suggest you post new thread on following Microsoft Tech Community forum.
    Tech Community --- OneDrive Developer

    Thanks for your understanding.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.