Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

How To Make a Javascript Text Editor using DroidScript Part 2

javascript how to

  • Please log in to reply
No replies to this topic

#1 YoungPythoner

YoungPythoner

    CC Newcomer

  • Member
  • PipPip
  • 17 posts
  • Location:Turkey, Hatay
  • Programming Language:Python, Bash, Others
  • Learning:JavaScript, Delphi/Object Pascal

Posted 03 July 2015 - 08:28 PM

Welcome guys!
We are in part 2 of my tutorial. Now we are writing variables and functions.
Functions is save and load!
Save:
We will save the text with WriteFile().
function save()
{
txt = txtbox.GetText()
filename = prompt("Write file name!")
app.WriteFile(filename, txt)
}
 
Load:
We will load a file with ReadFile().
function load()
{
filename = prompt("Write file name!")
settxt = app.ReadFile(filename)
txtbox.SetText(settxt)
}
 
And Run!
My tutorial is finished, hope you like it!
  • 0