By Melvin Dev
On this page
Javascript Studio allows you to create file and read files in two ways, One is open and closing tags like you do on HTML tags, and the other
is on design mode.
NOTE:
These are features, these are not a Javascript coding or part of Javascript development. and the code must be Commented
with <!-- --> or //
We are going to start with and small app and we will called Music Collection.
There is no difference on JavaScript Studio for Windows Phone and JavaScript Studio for Windows.
If you have not downloaded javascript studio please go to Download JavaScript Studio Page
Open Javascript Studio Professional and Tap "Blank App" button it will open the editor page
"I haven't developed any apps by now that's why the App section has nothing"
Tap Save App to save your App.
"Is recommended to save the app first before starting to code"
Write a name "Music Collection" and then "Tap Save Now"
Now you have created the app and saved it, we will start coding, you can remove the navigation part from the code, by now we will remove it, then "Tap Save Changes".
We will by start creating a file uisng the feature "built in tag code" to create a file follow the following steps
If you are curious and you want to Run the app now you will get an error thrown by Javascript Studio because the file has not specified a name.
Note that the 'JSS-Createfile' code must be commented as you see it. if not it will appear in the app when it is running.
If you close the app and go to the start page of Javascript Studio you will see the app saved, click the app again and it will be open running.
Save app
Running App
Even if you close the app and you open it Running you will get the same error because we have not written the file name, Tap Edit App button.
Now we have tested the app and we have seen the error, let's start writing a file name and adding text.
When we are creating a file Using JavaScript Studio you can have only one JSS-CreateFile tag, if you have more than one, the first tag will be evaluated and it will create the file, the rest will be ignored,
if you want to create another file you can create it writing a different file name, if you write a file name that already exist it will be overwriting the content.
After you have created a file you can delete all script tag JSS-CreateFile
You can read files the same way you create it. each file you create can be accessed from the same app only.
You have two ways to read a file, One is open and closing tags like you do on HTML tags, and the other
is on design mode.
We will read the file that we created in the previous section. to read a file using JSS-ReadFile Follow the following steps.
Try something, write an name you want inside of <Name> </Name> let's write a file name Movie tips
Tap Run Button you will see the error that the file does not exist
The easy way to read files is knowing the files that we have created. To see the files you have created in the app follow the following steps
Tap File Button at the top on the left of the screen a File Dialog will appear
From this File dialog you can perform Creating, Reading, Editing, Deleting Files.
Note that you can place the <ShowFileContentHere/> tag in any part of the code, the content file that we are reading will be shown there.
Now you have learned how to Create and save apps, Create file, Read file. you can continue exploring Javascript Studio to see how this app can help you on the Go "Using your windowsphone or tablet".