home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: Java
/
Java.zip
/
rdb084r2.zip
/
unixplug.Zip
/
txtimg.nrx
< prev
Wrap
Text File
|
1996-11-29
|
2KB
|
75 lines
/* A simple plug-in template */
/* Needed */
rHowManyFld = Rexx
rHowManyRec = Rexx
rFieldName = Rexx[]
rFieldValue = Rexx[,]
iCount = int
iCount2 = int
iCount3 = int
rx = RXFile()
/*
these three (rx2, rtime, pr2) are optional: needed only
for _this_ plugin.
(Needed to communicate with TGShow.class)
*/
rx2 = RXFile()
rtime = Runtime
pr2 = Process
/* Now the code needed */
rHowManyFld = rx.linein() /* How many fields? */
rFieldName = Rexx[rHowManyFld + 1]
loop iCount = 1 to rHowManyFld
rFieldName[iCount] = rx.linein() /* Get field names */
end
rHowManyRec = rx.linein() /* How many records? */
rFieldValue = Rexx[rHowManyFld + 1, rHowManyRec + 1]
loop iCount = 1 to rHowManyRec /* Records */
loop iCount2 = 1 to rHowManyFld
rFieldValue[iCount2, iCount] = rx.linein()
end
end
/*
Here it is the code which links to the running applet
and tells it where to find the images/texts.
*/
/* Let's find where is (if there /is/) the IMAGE field */
iCount2 = 0
loop iCount = 1 to rHowManyFld
if (((rFieldName[iCount]).strip()).left(5)).upper() = 'IMAGE' then
iCount2 = iCount
end
if iCount2 = 0 then exit
/* Let's find where is (if there /is/) the TEXT field */
iCount3 = 0
loop iCount = 1 to rHowManyFld
if (((rFieldName[iCount]).strip()).left(4)).upper() = 'TEXT' then
iCount3 = iCount
end
if iCount3 = 0 then exit
loop iCount = 1 to rHowManyRec -- Repeat for every record received.
/* fire up TGShow */
rtime = Runtime.getRuntime()
do
pr2 = rtime.exec("applet TGShow.htm")
catch NullPointerException
exit
end
rx2.attachtooutputstream(pr2.getOutputStream())
rx2.attachtoinputstream(pr2.getInputStream())
rx2.lineout(rFieldValue[iCount2, iCount]) -- Send the image file name
rx2.lineout(rFieldValue[iCount3, iCount]) -- Send the text file name
end