User Tools

Site Tools


doc:lua_make-your-own-scripts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
doc:lua_make-your-own-scripts [2014/08/17 10:51] – [The Communication Commands] admindoc:lua_make-your-own-scripts [2014/08/17 12:53] – [The Communication Commands] admin
Line 166: Line 166:
  
 In case you want to wait for some input strings, of which several could appear, you fill the //Optionstring// with string1|string2|..|stringN. If then one of this string appears at the input, the index of the found string is returned (first string=1). If the string does not appear within //msTimeout//, the function returns 0. In case you want to wait for some input strings, of which several could appear, you fill the //Optionstring// with string1|string2|..|stringN. If then one of this string appears at the input, the index of the found string is returned (first string=1). If the string does not appear within //msTimeout//, the function returns 0.
 +
 +
 +==== The IO  Commands ====
 +
 +FIXME the whole IO section is in pure experimental state. There's no guarantee that these functions are even exist, are implemented as described or not subject to change.
 +
 +
 +OOBD uses its own scheme for file IO, mainly driven by the restriction of a remote user and the need of complex data buffer handling.
 +
 +Similar to the LUA simple IO model, OOBD has always only just input and output file handle. As long as not redirected, these are stdin and stdout.
 +
 +As OOBD knows more as only one type of data sources, filenames are given as URL, not just as simple path.
 +
 +
 +
 +
 +=== ioInput(URL[,file_extension[,message]]) ===
 +
 +Set the actual input file stream to URL, where URL could be
 +
 +^  URL  ^  Description  ^
 +| ''FILE:<nowiki>//</nowiki>'' | Opens a file in the users file system. If the given file path is empty, just a directory or the given file does not exist, a file dialog opens. If given, the message and file_extension are used in the dialog |
 +| ''SCRIPT:<nowiki>//</nowiki>''| Opens a file in the script archive file system.  |
 +
 +
 +=== ioRead("*line") ===
 +Read one line of the input file ending with either \r\n or \n as string without the EOL. In case of input EOF or read errors the function returns nil
 +
 +=== ioRead ("*all") ===
 +Read the whole file as string
 +
 +=== ioRead (count) ===
 +Read count number of bytes as string
 +
 +=== ioOutput(URL[,append[,message]]) ===
 +
 +Try to opens ''URL'' as output. A ''SCRIPT:<nowiki>//</nowiki>'' URL is readonly and so not allowed as output. If append is TRUE, the output is appended to an already existing file. If the given file path is empty or just a directory, a file dialog opens. If given, the message is used in the dialog as title
 +
 +=== ioWrite (String) ===
 +Attaches the string content to the output file
 +
  
 ====  Miscellaneous  Commands ==== ====  Miscellaneous  Commands ====
doc/lua_make-your-own-scripts.txt · Last modified: 2019/04/08 18:43 by admin