home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
xclasinf.zip
/
xclasses.INF
(
.txt
)
< prev
Wrap
OS/2 Help File
|
1998-07-16
|
27KB
|
1,211 lines
ΓòÉΓòÉΓòÉ 1. The Author ΓòÉΓòÉΓòÉ
XCLASSES PACKAGE DOCUMENTATION
Author: (c) P.A.Marchesini, 1998
http://wwwinfo.cern.ch/news/netrexx/xclasses
Xclasses for NetRexx are Copyright 1998 by Pierantonio Marchesini of the ETH
/ Zurich
You can copy and use this software uder the GNU GPL terms
ΓòÉΓòÉΓòÉ 2. The Book ΓòÉΓòÉΓòÉ
This book is totally unauthorized, unofficial, unapproved and basically just
un.
It is based entirely on the work by P.A.Marchesini (xclasses Author) and is
merely an INF representation of the text files provided with his xclasses.
Comments on content, layout, syntax etc. should be sent to J. Pedone
(jpedone@flash.net). Comments concerning the xclasses should be directed
towards Mr. P.A.Marchesini.
ΓòÉΓòÉΓòÉ 3. Installation/Usage ΓòÉΓòÉΓòÉ
To install the xclasses you need to:
fetch "xclasses.jar" from the CERN URL (See Author)
copy the "xclasses.jar" in your preferred location
(I have them in "/java/lib/xclasses.jar")
add this location to your CLASSPATH
(I have a statement that says: Set
CLASSPATH=%CLASSPATH%;/java/lib/xclasses.jar If you installed NetRexx you
should know how to do it on your platform)
add the statement import xclasses. to your program, as the first sentence
you can find some code examples at
http://wwwinfo.cern.ch/news/netrexx/xclasses/demo
ΓòÉΓòÉΓòÉ 4. The Classes ΓòÉΓòÉΓòÉ
Related:
xarray
xcmdline
xdir
xexec
xfile
xftp
xmath
xsock
xsys
xtimer
xurl
ΓòÉΓòÉΓòÉ 4.1. xarray ΓòÉΓòÉΓòÉ
Handles array operations, and, mainly byte array conversions. It's a collection
of static methods.
NOTE: ARRAY needs to be defined as:
an_array= rexx[NNN]
another_array = rexx[NNN]
bytearray = byte[MMM]
Related:
init
copy
dump
ba2x
ba2c
ba2d
bagrepx
bahexdump
Next chapter:
xcmdline
ΓòÉΓòÉΓòÉ 4.1.1. init ΓòÉΓòÉΓòÉ
xarray.init(ARRAY,VALUE)
Initializes a Rexx array ARRAY with value VALUE.
Related:
Example
Next chapter:
copy
ΓòÉΓòÉΓòÉ 4.1.1.1. Example ΓòÉΓòÉΓòÉ
xarray.init(an_array,'test test')
ΓòÉΓòÉΓòÉ 4.1.2. copy ΓòÉΓòÉΓòÉ
xarray.copy(ARRAY1,ARRAY2)
copyes a Rexx array ARRAY1 into array ARRAY2.
Related:
Example
Next chapter:
dump
ΓòÉΓòÉΓòÉ 4.1.2.1. Example ΓòÉΓòÉΓòÉ
xarray.copy(an_array,another_array)
ΓòÉΓòÉΓòÉ 4.1.3. dump ΓòÉΓòÉΓòÉ
xarray.dump(ARRAY,ARRAYNAME)
Dumps the entries of ARRAY on the screen; duplicate lines are skipped.
Related:
Example
Next chapter:
ba2x
ΓòÉΓòÉΓòÉ 4.1.3.1. Example ΓòÉΓòÉΓòÉ
xarray.dump(an_array,'an_array')
ΓòÉΓòÉΓòÉ 4.1.4. ba2x ΓòÉΓòÉΓòÉ
xarray.ba2x(BYTEARRAY,START,LENGTH)
Convert byte array BYTEARRAY from byte to HEX string starting at byte START for
LENGTH bytes.
ΓòÉΓòÉΓòÉ 4.1.5. ba2c ΓòÉΓòÉΓòÉ
xarray.ba2c(BYTEARRAY,START,LENGTH)
Convert byte array BYTEARRAY from byte to CHAR string starting at byte START
for LENGTH bytes.
ΓòÉΓòÉΓòÉ 4.1.6. ba2d ΓòÉΓòÉΓòÉ
xarray.ba2d(BYTEARRAY,START,LENGTH)
Convert byte array BYTEARRAY from byte to DECIMAL string starting at byte START
for LENGTH bytes.
ΓòÉΓòÉΓòÉ 4.1.7. bagrepx ΓòÉΓòÉΓòÉ
loc = xarray.bagrepx(BYTEARRAY,SEARCH,START)
Will search in byte array BYTEARRAY the HEX string SEARCH, starting from START.
Related:
Example
Next chapter:
bahexdump
ΓòÉΓòÉΓòÉ 4.1.7.1. Example ΓòÉΓòÉΓòÉ
ptr = xarray.bagrepx(buf,'0D0F',0)
ΓòÉΓòÉΓòÉ 4.1.8. bahexdump ΓòÉΓòÉΓòÉ
xarray.bahexdump(BYTEARRAY,START,END)
Will dump HEX the contents of bytearray BYTEARRAY
Related:
Example
Next chapter:
xcmdline
ΓòÉΓòÉΓòÉ 4.1.8.1. Example ΓòÉΓòÉΓòÉ
fid = xfile('xarray.class')
rc = fid.readbuf()
xarray.bahexdump(fid.buffer,0,100)
ΓòÉΓòÉΓòÉ 4.2. xcmdline ΓòÉΓòÉΓòÉ
use this class to parse the command line options (which, in the
UNIX convention, are entered with a '-' sign).
Related:
xcmdline()
Next chapter:
xdir
ΓòÉΓòÉΓòÉ 4.2.1. xcmdline() ΓòÉΓòÉΓòÉ
cl = xcmdline(LINE,CONTROL)
Where:
LINE: line entered by the user
CONTROL : defines the control sequence to parse the options the format is:
FLAG/[FLA|VAR]/VARIABLE_NAME/DEFAULT_VALUE
Related:
Example
Notes
Next chapter:
xdir
ΓòÉΓòÉΓòÉ 4.2.1.1. Example ΓòÉΓòÉΓòÉ
cl = xcmdline(rexx(args),'t/FLA/TRACE/0' -
'r/FLA/REPLACE/0' -
'o/VAR/OUTFID/test.out')
If the user types:
mytest test -ro pippo.txt
Then:
say cl.arguments() = test
say cl.option('TRACE') = 1
say cl.option('REPLACE') = 0
say cl.option('OUTFID')= pippo.txt
ΓòÉΓòÉΓòÉ 4.2.1.2. Notes ΓòÉΓòÉΓòÉ
The next release will have a syntax like PERL getopt() available too
ΓòÉΓòÉΓòÉ 4.3. xdir ΓòÉΓòÉΓòÉ
Handles all operations on a directory, listing, comparing etc.
Related:
xdir()
str_ls()
Next chapter:
xexec
ΓòÉΓòÉΓòÉ 4.3.1. xdir() ΓòÉΓòÉΓòÉ
xdir(DIRECTORY)
xdir()
constructors. Default directory is the
current directory (".")
ΓòÉΓòÉΓòÉ 4.3.2. str_ls() ΓòÉΓòÉΓòÉ
str_ls(DIRECTORY) -
issue a "ls" command. Output returned in a REXX string.
Related:
Example
Notes
Next chapter:
xexec
ΓòÉΓòÉΓòÉ 4.3.2.1. Example ΓòÉΓòÉΓòÉ
say xdir.str_ls("/java")
ΓòÉΓòÉΓòÉ 4.3.2.2. Notes ΓòÉΓòÉΓòÉ
rc- return code of last valid operation options
ΓòÉΓòÉΓòÉ 4.4. xexec ΓòÉΓòÉΓòÉ
Use this class to run a system command.
Related:
xexec
Next chapter:
xfile
ΓòÉΓòÉΓòÉ 4.4.1. xexec ΓòÉΓòÉΓòÉ
cmd = xexec(COMMAND,OUTPUT,ONERROR)
Where:
COMMAND: is a valid command on the system you are running on (e.g.
"ls","cp","copy", etc.)
OUTPUT : can be any combination of:
SCREEN : the output will go on STDOUT
VAR: the output will go on a variable
ARRAY: the output will go on an array or
NULL : forget about output
ONERROR : is one of:
IGNORE: a return code <> 0 is ignored
WARNING : print a warning message if rc <> 0
ABORT : abandon ship if rc <> 0
Related:
Example
Notes
Next chapter:
xfile
ΓòÉΓòÉΓòÉ 4.4.1.1. Example ΓòÉΓòÉΓòÉ
test = xexec('cp test toast','NULL','ABORT')
test = xexec('pwd','VAR','ABORT')
say 'The path is "'test.out'".'
test = xexec('ls -l','ARRAY','WARNING')
loop i = 1 to test.line[0]
say '>>>' test.line[i]
end
cmd = xexec('jar -cvf test.jar *.class')
if cmd.rc <> 0
then xsys.die(300,'error from jar command.')
ΓòÉΓòÉΓòÉ 4.4.1.2. Notes ΓòÉΓòÉΓòÉ
The examples are valid on a UNIX platform
The examples are provided just as EXAMPLES there are infact better ways
to do 'ls','pwd' in NetRexx itself
lines : lines of output
line: array of output lines; line[0]=no.of out lines
out : string of output (when VAR is active)
rc: return code
ΓòÉΓòÉΓòÉ 4.5. xfile ΓòÉΓòÉΓòÉ
Handles all operations on files.
Related:
xfile()
read
write
options
Next chapter:
xftp
ΓòÉΓòÉΓòÉ 4.5.1. xfile() ΓòÉΓòÉΓòÉ
xfile(FNAME)
constructor
ΓòÉΓòÉΓòÉ 4.5.2. read ΓòÉΓòÉΓòÉ
xfile.read()
Read the ENTIRE file into an array OBJECT.line[i]
The number of lines is available in the variable OBJECT.line[0] or OBJECT.lines
Related:
Example
Next chapter:
write
ΓòÉΓòÉΓòÉ 4.5.2.1. Example ΓòÉΓòÉΓòÉ
read record 123 of a recfm=F lrecl=80 file:
fid = xfile('test.test')
fid.options('recfm=F,lrecl=80')
say fid.recread(123)
ΓòÉΓòÉΓòÉ 4.5.3. write ΓòÉΓòÉΓòÉ
xfile.write()
Write an ENTIRE file on disk from a buffer area OBJECT.line[i], where again
OBJECT.line[0] or OBJECT.lines contains the number of lines
Related:
Example
Next chapter:
options
ΓòÉΓòÉΓòÉ 4.5.3.1. Example ΓòÉΓòÉΓòÉ
ofid = xfile('test.txt')
ofid.options('replace=y')
loop i = 1 to 10
ofid.addline('test' i)
end
ofid.write()
ΓòÉΓòÉΓòÉ 4.5.4. options ΓòÉΓòÉΓòÉ
xfile.options(OPTIONSTRING)
Specifies the options for the file
The OPTIONSTRING is a sequence of keywords separated by a "," or by a " ".
valid keywords are:
RECFM=V | F
LRECL=nnn
REPLACE=Y | N
Related:
Example
Next chapter:
xftp
ΓòÉΓòÉΓòÉ 4.5.4.1. Example ΓòÉΓòÉΓòÉ
afid = xfile('test.txt')
afid.options('RECFM=F,LRECL=80,REPLACE=Y')
Demo:
You can look at tio.nrx.This will write and read back a filein "line mode"
ΓòÉΓòÉΓòÉ 4.6. xftp ΓòÉΓòÉΓòÉ
INSTANCE = xftp(HOST,[PORT])
Initiliazes an FTP session where INSTANCE will become the name of the session
used during subsequent commands.
Further commands directed toward HOST are referenced to INSTANCE rather than
xftp. i.e:
INSTANCE.xcd(DIR)
INSTANCE.xget(FID)
INSTANCE.xlogin(USERID PASSWORD) Note: No comma !
INSTANCE.xls(t)
INSTANCE.xmode(BINARY|ASCII)
INSTANCE.xmore(FID)
INSTANCE.xput(FID)
INSTANCE.xquery()
INSTANCE.xreplace(Y|N)
Note: For simplification, all of the above commands may be called as:
INSTANCE.xexec(CMD OPTIONS)
Where:
OPTIONS is used as needed and CMD is one of the following:
cd -- calls xcd(OPTIONS)
get -- calls xget(OPTIONS)
user -- calls xlogin(OPTIONS)
ls -- calls xls(OPTIONS)
binary -- calls xmode('BINARY')
ascii -- calls xmode('ASCII')
more -- calls xmore(OPTIONS)
put -- calls xput(OPTIONS)
query -- calls xquery()
replace -- calls xreplace(OPTIONS)
Related:
xcd
xget
xlogin
xls
xmode
xmore
xput
xquery
xreplace
Example
Next chapter:
xmath
ΓòÉΓòÉΓòÉ 4.6.1. xcd ΓòÉΓòÉΓòÉ
INSTANCE.xcd(DIR)
DIR is the directory to change to on the remote machine
ΓòÉΓòÉΓòÉ 4.6.2. xget ΓòÉΓòÉΓòÉ
INSTANCE.xget(FID)
Gets file FID from the remote machine.
ΓòÉΓòÉΓòÉ 4.6.3. xlogin ΓòÉΓòÉΓòÉ
INSTANCE.xlogin(USERID PASSWORD)
Logs in to the remote machine with the specified USERID and PASSWORD
ΓòÉΓòÉΓòÉ 4.6.4. xls ΓòÉΓòÉΓòÉ
INSTANCE.xls(T)
Displays the remote direcotory. T is undocumented at this time but may be a
timeout factor.
ΓòÉΓòÉΓòÉ 4.6.5. xmode ΓòÉΓòÉΓòÉ
INSTANCE.xmode(BINARY|ASCII)
Sets the file transfer mode.
ΓòÉΓòÉΓòÉ 4.6.6. xmore ΓòÉΓòÉΓòÉ
INSTANCE.xmore(FID)
Displays file FID on the screen
ΓòÉΓòÉΓòÉ 4.6.7. xput ΓòÉΓòÉΓòÉ
INSTANCE.xput(FID)
Puts local file FID onto the remote machine.
ΓòÉΓòÉΓòÉ 4.6.8. xquery ΓòÉΓòÉΓòÉ
INSTANCE.xquery()
Returns the present value of MODE (Binary or ASCII) and REPLACE (Yes or No)
ΓòÉΓòÉΓòÉ 4.6.9. xreplace ΓòÉΓòÉΓòÉ
INSTANCE.xreplace(Y|N)
Sets the file replace mode for XPUT and XGET operations to Yes or No.
ΓòÉΓòÉΓòÉ 4.6.10. Example ΓòÉΓòÉΓòÉ
A simple FTP session:
say 'This is just a small test connecting to "asisftp.cern.ch".'
ftpc = xftp('asisftp.cern.ch')
ftpc.cmd('user anonymous test@cern.ch')
ftpc.cmd('ascii')
ftpc.cmd('replace Y')
ftpc.cmd('get wylbur.help')
ΓòÉΓòÉΓòÉ 4.7. xmath ΓòÉΓòÉΓòÉ
Mainly provide conversion tools
Related:
n2cu
s2h
dotify
hexop
binop
random
gcd
gauss
Next chapter:
xsock
ΓòÉΓòÉΓòÉ 4.7.1. n2cu ΓòÉΓòÉΓòÉ
str = xmath.n2cu(NNN)
Converts numeric quantity NNN to computer units
Related:
Example
Next chapter:
s2h
ΓòÉΓòÉΓòÉ 4.7.1.1. Example ΓòÉΓòÉΓòÉ
say xmath.n2cu(2048)-> 2K
ΓòÉΓòÉΓòÉ 4.7.2. s2h ΓòÉΓòÉΓòÉ
str = xmath.s2h(SEC)
Converts SEC to HH:MM:SS
Related:
Example
Next chapter:
dotify
ΓòÉΓòÉΓòÉ 4.7.2.1. Example ΓòÉΓòÉΓòÉ
say xmath.s2h(3661)-> 1:01:01
ΓòÉΓòÉΓòÉ 4.7.3. dotify ΓòÉΓòÉΓòÉ
str = xmath.dotify(NNN)
Puts the "," in a big number, for easy reading
Related:
Example
Next chapter:
hexop
ΓòÉΓòÉΓòÉ 4.7.3.1. Example ΓòÉΓòÉΓòÉ
say xmath.dotify(100203) -> 100,203
ΓòÉΓòÉΓòÉ 4.7.4. hexop ΓòÉΓòÉΓòÉ
str = xmath.hexop(HEXOP)
Will execute a simple hex operation
Related:
Example
Next chapter:
binop
ΓòÉΓòÉΓòÉ 4.7.4.1. Example ΓòÉΓòÉΓòÉ
say xmath.hexop('1A + 10')-> 2A
ΓòÉΓòÉΓòÉ 4.7.5. binop ΓòÉΓòÉΓòÉ
str = xmath.binop(HEXOP)
Executes a simple bin operation.
Related:
Example
Next chapter:
random
ΓòÉΓòÉΓòÉ 4.7.5.1. Example ΓòÉΓòÉΓòÉ
say xmath.binop('10 + 11')-> 101
ΓòÉΓòÉΓòÉ 4.7.6. random ΓòÉΓòÉΓòÉ
n = xmath.random(MAX)
Returns an random integer with maximum value not greater than MAX.
Related:
Example
Next chapter:
gcd
ΓòÉΓòÉΓòÉ 4.7.6.1. Example ΓòÉΓòÉΓòÉ
say xmath.random(25) -> 12 (MAYBE)
ΓòÉΓòÉΓòÉ 4.7.7. gcd ΓòÉΓòÉΓòÉ
n = xmath.gcd(m,n)
Returns the Greatest Common Divisor of M and N.
ΓòÉΓòÉΓòÉ 4.7.8. gauss ΓòÉΓòÉΓòÉ
rc = xmath.gauss(N,A[,],Y[],C[])
Upon return code RC=0 it will find using the Gauss Method the solution C[] for
the array A[,] and vector Y[]
ΓòÉΓòÉΓòÉ 4.8. xsock ΓòÉΓòÉΓòÉ
INSTANCE = xsock(HOST,PORT)
Where PORT may be the actual port number or one of the following:
DAYTIME -- Default port 13
FTP -- Default port 21
TELNET -- Default port 23
FINGER -- Default port 79
NNTP -- Default port 119
IMAP -- Default port 143
HTTP -- Default port 80
Opens a socket connection to the specified HOST and PORT. INSTANCE is
used to reference future actions on this socket connection.
INSTANCE.send(WHAT)
INSTANCE.receive([SCREEN|ARRAY],[LENGTH])
INSTANCE.close()
Related:
send
receive
close
version
hostname
Example
Next chapter:
xsys
ΓòÉΓòÉΓòÉ 4.8.1. send ΓòÉΓòÉΓòÉ
INSTANCE.send(WHAT)
Sends string WHAT to the remote host.
ΓòÉΓòÉΓòÉ 4.8.2. receive ΓòÉΓòÉΓòÉ
INSTANCE.receive([SCREEN|ARRAY],[LENGTH])
Receives a stream of max. length LENGTH and either displays it to SCREEN or
stores it in the array named by ARRAY.
Default is SCREEN and max. length of 10000
ΓòÉΓòÉΓòÉ 4.8.3. close ΓòÉΓòÉΓòÉ
INSTANCE.close()
Closes the current socket connection
ΓòÉΓòÉΓòÉ 4.8.4. version ΓòÉΓòÉΓòÉ
xsock.version()
Displays the version information.
ΓòÉΓòÉΓòÉ 4.8.5. hostname ΓòÉΓòÉΓòÉ
NAME = xsock.hostname()
Gets the name of the currently connected host.
ΓòÉΓòÉΓòÉ 4.8.6. Example ΓòÉΓòÉΓòÉ
args = args
rc = rc
xsock.version()
say 'Testing hostname()'
say xsock.hostname()
say
say 'Testing daytime service'
so = xsock('shift3.cern.ch','DAYTIME')
so.receive('')
so.close()
say
say 'Testing finger service'
so = xsock('shift3.cern.ch','FINGER')
so.send('pippo')
so.receive('')
so.close()
say
exit 0
ΓòÉΓòÉΓòÉ 4.9. xsys ΓòÉΓòÉΓòÉ
This is just a collection of methods for "system" relatedinformation.
Related:
userid
nodeid
time
date
xdate
die
sleep
Next chapter:
xtimer
ΓòÉΓòÉΓòÉ 4.9.1. userid ΓòÉΓòÉΓòÉ
str = xsys.userid()
Will return your current userid.
Related:
Example
Next chapter:
nodeid
ΓòÉΓòÉΓòÉ 4.9.1.1. Example ΓòÉΓòÉΓòÉ
say 'I am running on user "'xsys.userid()'".'
ΓòÉΓòÉΓòÉ 4.9.2. nodeid ΓòÉΓòÉΓòÉ
str = xsys.nodeid()
Will return the name of the node you are running on.
Related:
Example
Next chapter:
time
ΓòÉΓòÉΓòÉ 4.9.2.1. Example ΓòÉΓòÉΓòÉ
say 'I am running on system "'xsys.nodeid()'".'
ΓòÉΓòÉΓòÉ 4.9.3. time ΓòÉΓòÉΓòÉ
str = xsys.time()
str = xsys.time(FMT)
Will return the current time.
FMT is the same as on Classical REXX
Related:
Example
Next chapter:
date
ΓòÉΓòÉΓòÉ 4.9.3.1. Example ΓòÉΓòÉΓòÉ
say 'Now is:' xsys.time()'.'
ΓòÉΓòÉΓòÉ 4.9.4. date ΓòÉΓòÉΓòÉ
str = xsys.date()
str = xsys.date(FMT)
Will return the current date.
FMT is the same as on Classical REXX
Related:
Example
Next chapter:
xdate
ΓòÉΓòÉΓòÉ 4.9.4.1. Example ΓòÉΓòÉΓòÉ
say 'Today is' xsys.date()'.'
ΓòÉΓòÉΓòÉ 4.9.5. xdate ΓòÉΓòÉΓòÉ
str = xsys.xdate(IFMT,DATE,OFMT)
Will perform date conversion.
Related:
Example
Next chapter:
die
ΓòÉΓòÉΓòÉ 4.9.5.1. Example ΓòÉΓòÉΓòÉ
say xsys.xdate('E','12/01/97'.'J')
Prints 31 Dec 1998 from European format to Julian:
say xsys.xdate('E','31/12/98','J')
Prints next Monday in Julian format:
say xsys.xdate('NEXT','MONDAY','J') --
ΓòÉΓòÉΓòÉ 4.9.6. die ΓòÉΓòÉΓòÉ
xsys.die(RC,MESSAGE)
Program will abort with RC return code, displaying MESSAGE on STDOUT;
Related:
Example
Next chapter:
sleep
ΓòÉΓòÉΓòÉ 4.9.6.1. Example ΓòÉΓòÉΓòÉ
xsys.die(320,'Program aborted.')
cmd = xexec('jar -cvf test.jar *.class')
if cmd.rc <> 0
then xsys.die(300,'error from jar command.')
ΓòÉΓòÉΓòÉ 4.9.7. sleep ΓòÉΓòÉΓòÉ
xsys.sleep(SEC)
Program will sleep for SEC seconds
ΓòÉΓòÉΓòÉ 4.10. xtimer ΓòÉΓòÉΓòÉ
Use xtimer class to build timers inside your programs.
Related:
xtimer()
reset
elapsed
Next chapter:
xurl
ΓòÉΓòÉΓòÉ 4.10.1. xtimer() ΓòÉΓòÉΓòÉ
xtimer()
Constructor
The starting time is set to 0.000 sec
ΓòÉΓòÉΓòÉ 4.10.2. reset ΓòÉΓòÉΓòÉ
xtimer.reset()
The timer is reset to 0.000 sec
ΓòÉΓòÉΓòÉ 4.10.3. elapsed ΓòÉΓòÉΓòÉ
xtimer.elapsed()
Returns the elapsed time since the last reset() (or object creation)
Format is SSSSS.MMM (seconds.milliseconds)
Related:
Example
Next chapter:
xurl
ΓòÉΓòÉΓòÉ 4.10.3.1. Example ΓòÉΓòÉΓòÉ
atimer = xtimer()
-- some job here
--
say 'Took.....:' atimer.elapsed'(sec).'
atimer.reset()
-- some other job here
--
say 'Took.....:' atimer.elapsed'(sec).'
ΓòÉΓòÉΓòÉ 4.11. xurl ΓòÉΓòÉΓòÉ
INSTANCE = xurl(ADDRESS)
Defines an instance of xurl for reference when performing future actions i.e:
INSTANCE.options([TRACE|NOTRACE],[INFO|NOINFO],[REPLACE|NOREPLACE],[STATUS|NOSTATUS)
INSTANCE.readlines()
INSTANCE.fetch(RFID,[LFID])
INSTANCE.fetchall(MASK)
INSTANCE.getreferences()
Related:
options
readlines
fetch
fetchall
getreferences
version
Example
ΓòÉΓòÉΓòÉ 4.11.1. options ΓòÉΓòÉΓòÉ
INSTANCE.options([TRACE|NOTRACE],[INFO|NOINFO],[REPLACE|NOREPLACE],[STATUS|NOSTATUS)
Where:
TRACE = Echoes the connection address
NOTRACE = Does not echo the connection address
INFO = Echos processing info to the screen
NOINFO = Does not echo processing info to the screen
REPLACE = Overwrite local file on fetch operations
NOREPLACE = Do not overwrite local file on fetch operations
STATUS = Echoes the amount of data read
NOSTATUS = Does not echo the amount of data read
ΓòÉΓòÉΓòÉ 4.11.2. readlines ΓòÉΓòÉΓòÉ
INSTANCE.readlines()
Reads the reference URL into an array
ΓòÉΓòÉΓòÉ 4.11.3. fetch ΓòÉΓòÉΓòÉ
INSTANCE.fetch(RFID,[LFID])
Fetches the remote file RFID and stores it into the local file LFID
ΓòÉΓòÉΓòÉ 4.11.4. fetchall ΓòÉΓòÉΓòÉ
INSTANCE.fetchall(MASK)
Fetches all referenced documents with extensions matching MASK.
ΓòÉΓòÉΓòÉ 4.11.5. getreferences ΓòÉΓòÉΓòÉ
INSTANCE.getreferences()
Gets all referenced documents and stores them in string INSTANCE.referencelist
ΓòÉΓòÉΓòÉ 4.11.6. version ΓòÉΓòÉΓòÉ
xurl.version()
Displays the version information
ΓòÉΓòÉΓòÉ 4.11.7. Example ΓòÉΓòÉΓòÉ
Will fetch ALL the html files contained in the Netrexx Tutorial
page = xurl('http://wwwinfo.cern.ch/news/netrexx/html/nr_toc.html')
page.readlines()
page.getreferences()
list = page.referencelist
say list
loop while list <> ''
parse list item list
xurl.fetch(page.base||item)
end