Hello
I've been pulling my hair out!
How can I set the text to display but in different lines? (New line but gets the data from read file and inserts the data singulary on a new line?
//Called when application is started.
function OnStart()
{
app.GetPrivateFolder( "","external" )
//Create a layout with objects vertically centered.
lay = app.CreateLayout( "Linear", "VCenter,FillXY" )
app.WriteFile( "taskMania.txt", "\n", "Append" );
var txt = app.ReadFile("taskMania.txt");
// var length = txt.split("\n").length;
var length = txt.split("\n");
// app.ShowPopup("myFile contains " + length + " lines");
alert(txt)
getInput1 = prompt("Enter task");
app.WriteFile( "taskMania.txt", getInput1,"Append" );
app.ReadFile("taskMania.txt");
alert(getInput1)
//Create a text label and add it to layout.
var txt2 = app.CreateText(txt,"MultiLine","Html") //WANT TO INSERT INPUT DATA INTO NEW A NEW LINE BUT NOT WORKING
txt2.SetTextSize( 10 )
lay.AddChild( txt2 )
// txt2 = txt.replace(/\n/g,"")
txt2.SetText( txt.split("\n" ));
//Add layout to app.
app.AddLayout( lay )
}