Difference between revisions of "FILETOSTR()"
From Lianjapedia
Yvonne.milne (Talk | contribs) (→Description) |
|||
(11 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Function to read a file into a text string | Function to read a file into a text string | ||
− | |||
==Syntax== | ==Syntax== | ||
FILETOSTR(<expC>) | FILETOSTR(<expC>) | ||
− | |||
==See Also== | ==See Also== | ||
− | [[AT()]], [[ATNEXT()]], [[FCLOSE()]], [[FCREATE()]], [[FERROR()]], [[FGETS()]], [[FOPEN()]], [[FPUTS()]], [[FREAD()]], [[FREADSTR()]], [[FWRITE()]], [[MEMOREAD()]], [[MEMOWRITE()]], [[SET STRESCAPE]], [[STUFF()]], [[STR()]], [[STREXTRACT()]], [[STRTOFILE()]], [[STRTRAN()]], [[STRZERO()]], [[SUBSTR | + | [[AT()]], [[ATNEXT()]], [[BINFILETOSTR()]], [[BINSTRTOFILE()]], [[FCLOSE()]], [[FCREATE()]], [[FERROR()]], [[FGETS()]], [[FOPEN()]], [[FPUTS()]], [[FREAD()]], [[FREADSTR()]], [[FWRITE()]], [[MEMOREAD()]], [[MEMOWRITE()]], [[SET STRESCAPE]], [[STUFF()]], [[STR()]], [[STREXTRACT()]], [[STRTOFILE()]], [[STRTRAN()]], [[STRZERO()]], [[SUBSTR()]], [[TRIM()]] |
− | + | ||
==Description== | ==Description== | ||
The FILETOSTR() function reads the specified file and returns its contents as text. | The FILETOSTR() function reads the specified file and returns its contents as text. | ||
− | + | {| class="wikitable" width="100%" | |
− | {| class="wikitable" | + | !width="20%"|Parameter||Description |
− | !Parameter||Description | + | |
|- | |- | ||
− | |<expC>||Name of the file to be read. This should include the path if not in the current directory. | + | |valign="top"|<expC>||Name of the file to be read. This should include the path if not in the current directory. |
|- | |- | ||
|} | |} | ||
+ | From v7.0, the filetostr() function is also supported in Python scripting. | ||
==Example== | ==Example== | ||
Line 28: | Line 25: | ||
</code> | </code> | ||
− | |||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
− | |||
[[Category:String Data Functions]] | [[Category:String Data Functions]] | ||
+ | [[Category:ASCII File Access Functions]] | ||
+ | [[Category:Lianja v7.0]] | ||
+ | [[Category:Python Scripting]] |
Latest revision as of 05:23, 24 January 2022
Contents
Purpose
Function to read a file into a text string
Syntax
FILETOSTR(<expC>)
See Also
AT(), ATNEXT(), BINFILETOSTR(), BINSTRTOFILE(), FCLOSE(), FCREATE(), FERROR(), FGETS(), FOPEN(), FPUTS(), FREAD(), FREADSTR(), FWRITE(), MEMOREAD(), MEMOWRITE(), SET STRESCAPE, STUFF(), STR(), STREXTRACT(), STRTOFILE(), STRTRAN(), STRZERO(), SUBSTR(), TRIM()
Description
The FILETOSTR() function reads the specified file and returns its contents as text.
Parameter | Description |
---|---|
<expC> | Name of the file to be read. This should include the path if not in the current directory. |
From v7.0, the filetostr() function is also supported in Python scripting.
Example
myString = filetostr("myfile.txt")