source: NEWT0/trunk/documents/04_library.txt @ 1

Revision 1, 1.1 KB checked in by gnue, 7 years ago (diff)

import project

Line 
1Šg’£ƒ‰ƒCƒuƒ‰ƒŠ
2-------------
3
4
5¡protoFILE
6
7@à–¾Fƒtƒ@ƒCƒ‹“üo—Í
8@Žg—p•û–@F
9
10@@//Šg’£ƒ‰ƒCƒuƒ‰ƒŠ‚Ì—v‹
11@@Require("protoFILE");
12
13@@//ƒtƒŒ[ƒ€‚̍쐬
14@@file := {_proto: @protoFILE};
15@@//ƒI[ƒvƒ“(mode ‚Í man fopen ‚ðŽQÆj
16@@file:open(path, mode);
17
18@@//o—Í
19@@file:print(str);
20@@//‚Ps“ü—Í
21@@line := file:gets();
22@@//ƒoƒCƒiƒŠ“ü—Í
23@@binary := file:read(len);
24@@//EOF ‚̃`ƒFƒbƒN
25@@file:eof();
26@@//ƒV[ƒN
27@@file:seek(offset, whence);  // whence: 'set, 'curr or 'end
28@@//ƒtƒ@ƒCƒ‹ƒ|ƒCƒ“ƒ^‚̎擾
29@@file:tell();
30@@//ƒtƒ@ƒCƒ‹ƒ|ƒCƒ“ƒ^‚ð 0 ‚É–ß‚·
31@@file:rewind();
32
33@@//ƒNƒ[ƒY
34@@file:close();
35
36
37¡protoREGEX
38
39@à–¾F³‹K•\Œ»
40@Žg—p•û–@F
41
42@@//Šg’£ƒ‰ƒCƒuƒ‰ƒŠ‚Ì—v‹
43@@Require("protoREGEX");
44
45@@//³‹K•\Œ»ƒIƒuƒWƒFƒNƒg‚̍쐬
46@@// Žg—p‚Å‚«‚鐳‹K•\Œ»‚Í man regex ‚ðŽQÆ
47@@// ƒIƒvƒVƒ‡ƒ“‚Í i ‚Æ m ‚ªŽg—p‰Â”\
48@@reg := /³‹K•\Œ»‚̃pƒ^[ƒ“/ƒIƒvƒVƒ‡ƒ“;
49
50@@//ƒpƒ^[ƒ“ƒ}ƒbƒ`‚ÌŽÀs
51@@// str c@ŒŸõ‘Ώۂ̕¶Žš—ñ
52@@// –ß‚è’l nil c ޏ”s
53@@// –ß‚è’l ”z—ñ c ¬Œ÷iƒ}ƒbƒ`‚µ‚½•”•ª•¶Žš—ñ‚ª”z—ñ‚Ì—v‘f‚É“ü‚éj
54@@matchs = reg:match(str);
55
56@@//ŒãŽn––iNewtonScript ‚ɃfƒXƒgƒ‰ƒNƒ^‚ª‚È‚¢‚½‚߁j
57@@reg:cleanup();
Note: See TracBrowser for help on using the repository browser.