After you've done the required initialization, the next thing you need to do is actually make sure that you're connected to the internet. (This may be necessary for a dial-up modem, or other type of internet connection that is not "always on"). You call the InetDial function. This function checks if the computer is already connected to the internet, and if not, it can optionally present (to the enduser) a dial-up dialog box to initiate a connection to the Internet. Typically, you'll let InetDial connect to the internet using the default connection (ie, whatever internet provider the user has setup on his computer as the default connection), and then return.

The first arg you pass to InetDial affects whether the user is prompted to allow connection, or not. If you omit this arg, then the default is to check for an internet connection, and if not connected, prompt the user with a dialup dialog. The user may choose to instead go into "offline mode" by clicking on that button in the dialup dialog.

The second arg you pass is a handle to some window you opened (for example, a REXX GUI window, whose handle is in the GuiWindow variable). If you don't have your own window, you can omit this arg.

If InetDial can't connect to the internet (due to a problem, or maybe because the enduser cancels or chooses to go into "Offline mode" by clicking on that button in the connection dialog), it will either return an error message, or raise some condition, depending upon how you set the InetErr variable.

Here then is how you connect to the internet:

InetDial()
After InetDial returns, your script should have a connection to the internet (or be in offline mode).

Note: If you using RexxINet to transfer data over a local area network (LAN), then you don't need to call InetDial.