Put URL

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
keyless
Posts: 211
Joined: Wed Dec 12, 2007 11:21 pm

Put URL

Post by keyless » Sat Mar 08, 2008 11:26 pm

I have questions about using put URL to write to txt file locally

will it create a folder if I extend the file path, the same way it creates the file if it doesn't exist?

What is the proper way to put in the file path, I've seen several ways when searching for info. I was thinking of using:

Code: Select all

put fld "Pref" into url "/Documents and Settings/All Users/Application Data"
(yes this is for a windows only app)

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Sun Mar 09, 2008 12:07 am

"put URL" will not create a folder for you. Use the "create folder" command for that.

To see how a proper file path would look like, I suggest this code in the message box:

Code: Select all

answer folder ""; put it
That way you'll always be sure that it is the correct one.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

keyless
Posts: 211
Joined: Wed Dec 12, 2007 11:21 pm

Post by keyless » Sun Mar 09, 2008 4:41 am

BvG wrote:"put URL" will not create a folder for you. Use the "create folder" command for that.

To see how a proper file path would look like, I suggest this code in the message box:

Code: Select all

answer folder ""; put it
That way you'll always be sure that it is the correct one.

I did that and get : C:/Documents and Settings/All Users/Application Data

However

Code: Select all

put fld "Pref" into url "C:/Documents and Settings/All Users/Application Data/settings.txt"
Doesn't work

Ok figured it out, I need to add "File:" before the path.

Post Reply