Difference between revisions of "0A9A"
Jump to navigation
Jump to search
(Created page with "{{OpCode | games = {{Icon|t}} (with CLEO) | description = Opens the file | syntax1 = 0A9A: [''var''] = openfile "[''string1'']" mode "[''string2'']" | syntax2...") |
m |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
| syntax1 = 0A9A: [''var''] = openfile "[''string1'']" mode "[''string2'']" | | syntax1 = 0A9A: [''var''] = openfile "[''string1'']" mode "[''string2'']" | ||
| syntax2 = 0A9A: [''var''] = openfile "[''string1'']" mode [''int''] | | syntax2 = 0A9A: [''var''] = openfile "[''string1'']" mode [''int''] | ||
− | | p1t = ['' | + | | p1t = [''string1''] |
− | | p1d | + | | p1d = File name (if using relative path, it is relative to game's directory) |
− | + | | p2t = [''string2''] | |
− | + | | p2d = Mode (see <code>[http://en.cppreference.com/w/cpp/io/c/fopen fopen]</code> for explanation) | |
− | | | + | | p3t = [''var''] |
− | | | + | | p3d = Variable to store the handle of the file |
| p4t = [''int''] | | p4t = [''int''] | ||
− | | p4d = Mode, e.g. "r" is 0x72, "rb" is | + | | p4d = Mode, e.g. "r" is 0x72, "rb" is 0x6272 |
}} | }} | ||
This [[CLEO]] opcode opens the file. It is also conditional, returning true if the file exists. | This [[CLEO]] opcode opens the file. It is also conditional, returning true if the file exists. | ||
+ | |||
+ | == Example == | ||
+ | :''See [[0AD9#Example]], [[0ADA#Example]]'' | ||
+ | |||
+ | == Keywords == | ||
+ | open, file, openfile | ||
[[Category:CLEO Opcodes]] | [[Category:CLEO Opcodes]] |
Latest revision as of 04:33, 18 January 2017
(with CLEO)
- Description
- Opens the file
- Syntax
- 0A9A: [var] = openfile "[string1]" mode "[string2]"
- 0A9A: [var] = openfile "[string1]" mode [int]
- Parameter
- [string1]
- File name (if using relative path, it is relative to game's directory)
- [string2]
- Mode (see
fopen
for explanation) - [var]
- Variable to store the handle of the file
- [int]
- Mode, e.g. "r" is 0x72, "rb" is 0x6272
This CLEO opcode opens the file. It is also conditional, returning true if the file exists.
Example
- See 0AD9#Example, 0ADA#Example
Keywords
open, file, openfile