OPENURL Procedure
Opens a file on the Internet to be accessed (through Java) using PV‑WAVE.
Usage
OPENURL, url, Unit = unit
Input Parameters
urlA string containing a Uniform Resource Locator (URL) for the document (file) to be read.
Input Keywords
Proxy—A string containing the host name of a proxy server (firewall) if required by your network; or, of the form 'hostname:nn', where nn is a number specifying the port number of the proxy server.
Output Keywords
Unit—(Required) The file unit returned by OPENURL. This file unit is required by OPENR, READF, and READU procedures in order to access the content of the URL.
Discussion
Java software must be available in your path and its location must be in the operating-system search path before you start PV‑WAVE. (You should be able to run a Java program by typing java and the program name at the OS prompt.)
The OPENURL procedure spawns a Java process to open and read an URL anywhere on the Internet. It then passes the data to an open unit, which can be processed by a READF or READU procedure call.
 
note
On Windows, make sure that one of the environment variables TMP or TEMP, or the PV-WAVE system variable !PVWDATA is set to a writable directory to enable temporary file writing.
Example
For other examples of using PV‑WAVE across the Internet, see the demonstrations under the following directories:
(UNIX) <wavedir>/demo/web
(WIN) <wavedir>\demo\web
where <wavedir> is the main PV‑WAVE directory.
This example procedure uses OPENURL, keeping the file in unit while reading and writing the file to standard output until no more strings are found.
PRO openurl_ex1, url=url
   ; Verify that the URL exists.
   IF N_ELEMENTS(url) EQ 0 THEN $
      url = 'http://www.roguewave.com'
   OPENURL, url, unit=unit
   str = '' 
   ON_IOERROR, done 
   ; Read and print the content of the URL file.
   WHILE 1 DO BEGIN
      READF, unit, str
      PRINT, str 
   ENDWHILE
   done:
END
See Also