source: NEWT0/trunk/documents/en.04_library.txt @ 133

Revision 133, 1.2 KB checked in by matthiasm, 3 years ago (diff)

Converted documentation from Japanese into what Google claims to be English. Manually improved a few lines of the translation, but I am not sure if I got it right.

  • Property svn:executable set to *
Line 
1Extended library
2-------------
3
4
5■ protoFILE
6
7Description: The file input and output
8How to use:
9
10/ / Extension request for library
11Require ( "protoFILE");
12
13/ / Create a frame
14File: = (_proto: @ protoFILE);
15/ / Open (mode refers to a man fopen)
16File: open (path, mode);
17
18/ / Output
19File: print (str);
20/ / 1 line input
21Line: = file: gets ();
22/ / Binary input
23Binary: = file: read (len);
24/ / EOF check
25File: eof ();
26/ / Seek
27file: seek (offset, whence); / / whence: 'set,' curr or 'end
28/ / Retrieve the file pointer
29File: tell ();
30/ / File pointer back to 0
31File: rewind ();
32
33/ / Close
34File: close ();
35
36
37■ protoREGEX
38
39Description: The regular expression
40How to use:
41
42/ / Extension request for library
43Require ( "protoREGEX");
44
45/ / Create a regular expression object
46/ / You can use regular expressions refer to the man regex
47/ / M i and that option is available
48reg: = / regular expression pattern / options;
49
50/ / Pattern matching run
51/ / Str ... a string of search
52/ / Return value fails nil ...
53/ / Returns an array ... success (partial matching elements of a string into an array)
54Matchs = reg: match (str);
55
56/ / Clean up (NewtonScript do not have a destructor)
57Reg: cleanup ();
Note: See TracBrowser for help on using the repository browser.