Newbie Questions

Jim Ault JimAultWins at yahoo.com
Sun Nov 4 17:15:33 EST 2007


On 11/4/07 2:58 PM, "Jonathan Scott" <songe at agate.plala.or.jp> wrote:
> I have a stack that is supposed to write out text files.  When I use
> the normal file writing procedure (as shown below):
> 
> open file thisfile for write
> write thisstuff to file thisfile
> close file thisfile
> 

--hint: it might be better to add the extension, eg.  ".txt"
--URL  file:  only works for  'text' files, not images
or other binary code files.
--the path you specify must exist
--the defaultfolder always has a setting to something

--------- copy code below this line---------

answer "a file will be written to :" & cr & the defaultFolder
answer folder "Choose a folder... any folder"
put it into fullPathName
answer fullPathName

answer file "Choose a file ... any file "
put it into fullFileName
answer fullFileName

put fullPathName & cr & fullFileName into msg

set the defaultFolder to fullPathName
put the seconds & " seconds " & cr & msg into url ("file:thisfile.txt")
answer "my new file exists =" & (there is a file "thisfile.txt")

set the defaultFolder to specialFolderPath("Desktop")
put the ticks & " ticks" & cr & msg into url ("file:thisfile.txt")
answer "my new file exists =" & (there is a file "thisfile.txt")



----------------- end copy code above this line ------------

Copy the above lines (without the ----------- lines),
go to Rev, activate the message box
click on the second tab (multi-line messages)
paste in the code lines, then hit the enterkey to execute

Follow the bouncing dialog boxes.

This should get you pretty far down the path :-)

Jim Ault
Las Vegas





More information about the Use-livecode mailing list