You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/dictionary/keyword/URL.lcdoc
+25-8Lines changed: 25 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -18,24 +18,41 @@ Example:
18
18
get URL "http://www.xworlds.com/index.html"
19
19
20
20
Example:
21
-
put URL "binfile:/Mac HD/Files/example.gif" into image "Example Logo"
21
+
put URL "binfile:/Users/myuser/Files/example.gif" into image "Example Logo"
22
22
23
23
Example:
24
24
post field "Results" to URL "http://www.example.org/current.txt"
25
25
26
26
Example:
27
27
get URL "http://www.xworlds.com/index.html"
28
28
29
+
Example:
30
+
put "Hello World" into URL "file:/Users/myuser/Documents/sample.txt"
31
+
32
+
Example:
33
+
# Writing the contents of a field to an external file, preserving text encoding
34
+
on textSave
35
+
put "всем привет" into field "russiantext"
36
+
put textEncode(field "russiantext","UTF-8") into "binfile:/Users/myuser/Documents/russtext.txt"
37
+
end textSave
38
+
# Reading contents of a file into LiveCode, preserving text encoding
39
+
on textRead
40
+
local tText
41
+
put URL "binfile:/Users/myuser/Documents/russtext.txt" into tText
42
+
put textDecode(tText,"UTF-8") into field "russiantext"
43
+
end textRead
44
+
29
45
Description:
30
46
Use the <URL> <keyword> to access the contents of a local <file> or a <file> accessible on the Web.
31
47
32
-
A <URL> is a method of designating a file or other resource. You can use a <URL> like any other container. You can get the contents of a <URL> or use its contents in any expression. LiveCode supports the following <URL> schemes:
48
+
A <URL> is a method of designating a file or other resource. You can use a <URL> like any other container.
49
+
You can get the contents of a <URL> or use its contents in any expression. LiveCode supports the following <URL> schemes:
33
50
34
-
http: a page from a web server
35
-
ftp: a directory or file on an FTP server
36
-
<file> : a text file on the local disk (not on a server)
37
-
binfile: a binary file
38
-
resfile: on Mac OS and OS X systems, the resource fork of a file
51
+
* http: a page from a web server
52
+
* ftp: a directory or file on an FTP server
53
+
* file: a text file on the local disk (not on a server)
54
+
* binfile: a binary file
55
+
* resfile: on Mac OS and OS X systems, the resource fork of a file
39
56
40
57
All actions that refer to a <URL> container are blocking: that is, the handler pauses until LiveCode is finished accessing the <URL>. Since fetching a web page may take some time due to network lag, accessing URLs may take long enough to be noticeable to the user. To avoid this delay, use the load command (which is non-blocking) to cache web pages before you need them.
41
58
@@ -49,4 +66,4 @@ From LiveCode 7.0.0, URL keyword has been upgraded to understand Unicode files w
0 commit comments