murlen.util.fscript
Class BasicIO

java.lang.Object
  extended bymurlen.util.fscript.FScript
      extended bymurlen.util.fscript.BasicIO
All Implemented Interfaces:
FSArrayExtension, FSExtension, FSFunctionExtension, FSVarExtension

public class BasicIO
extends FScript

BasicIO - an simple IO Subclass of FScript

Copyright (C) 2000 murlen.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA

Author:
murlen\ CVSTEST

Constructor Summary
BasicIO()
          Constructor
 
Method Summary
 java.lang.Object callFunction(java.lang.String name, java.util.ArrayList param)
           Overridden from FScript implements the following FScript functions
 
Methods inherited from class murlen.util.fscript.FScript
callScriptFunction, cont, evaluateExpression, getContext, getError, getScriptVar, getVar, getVar, load, loadLine, registerExtension, reset, run, setScriptVar, setVar, setVar, unRegisterExtension
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicIO

public BasicIO()
Constructor

Method Detail

callFunction

public java.lang.Object callFunction(java.lang.String name,
                                     java.util.ArrayList param)
                              throws FSException

Overridden from FScript implements the following FScript functions

note that this only provides very basic IO facilities, line by line read/write to files, and stdio read write. There is a maximum of 25 open files

(void) println(param...) - write to stdout - takes variable parameter list

string readln() - reads a string from stdin

int open(string filename,string mode) - opens a file 'filename' for reading (mode="r") or writing (mode="w") returns an integer which is used in future calls. Returns -1 on >25 files opened

string read(fp) - reads one line from previously openened file

void write(fp,param...) - writes concatination of all params to one line of file

Specified by:
callFunction in interface FSFunctionExtension
Overrides:
callFunction in class FScript
Parameters:
name - the function name
param - an ArrayList of parameter values
Returns:
an Object, currently expected to be Integer or String
Throws:
FSException