How to place a Label txt onto a text file.
Posted: Sun Jun 16, 2013 9:59 am
Hello everybody. I am new to Live code. I just started 2 day ago. I was poking around the help pages but unable to find this info and would request help from the live code gurus.
Basically I have a Label named "Name" and a text field call name. I managed to copy what the user enters into the text field name into the text file which is saved on the desktop but I am not able to copy the Label name which is "Name" onto the text file.
Can some please explain the codes to place the Label name "Name" onto the text file and write beside that is the text field called name.
As such the text file will look like this
Name: Helen
Currently with the below code i get this:
Helen
Thank you
Basically I have a Label named "Name" and a text field call name. I managed to copy what the user enters into the text field name into the text file which is saved on the desktop but I am not able to copy the Label name which is "Name" onto the text file.
Can some please explain the codes to place the Label name "Name" onto the text file and write beside that is the text field called name.
As such the text file will look like this
Name: Helen
Currently with the below code i get this:
Helen
Code: Select all
global yourName
global myText
on mouseUp
// save what the user types into our variables
put field "name" into yourName
// now use them
answer "You are " & yourName
open file specialFolderPath("desktop") & "/vr.txt" for write
put yourName into myText
write label of Name "Name" & return to vr.txt
write myText to file specialFolderPath("desktop") & "/vr.txt"
close file specialFolderPath("desktop") & "/vr.txt"
end mouseUp