Real websites respond slow or not at all sometimes. IIM has several timeout commands to handle all situations.
1. Command level timeout.
This is the "normal" timeout if a web page does not respond or a certain tag can not be found. The default value is 60s. It can be changed either globally (for all macros) in the OPTIONS dialog or using SET !TIMEOUT <timeout> inside each macro. A timeout command inside the macro will alway overwrite any global settings.
<timeout> stands for the timeout value in seconds. Example: SET !TIMEOUT 120 => timeout in 120 seconds (2 minutes)
2. Macro level timeout
The macro level timeout creates a timeout error (-321) if the overall macro run time exceeds a certain value. It can be changed using SET !MACROTIMEOUT <timeout> inside each macro. A timeout value of "0" means no timeout. The default is no macro level timeout.
3. Command line timeout
If you start the IIM browser via the command line, you can use the "-timeout <timeout>" command line switch. This command is intended to watch the overall IIM run time and avoid any "hung" instances of IIM. If this timeout is reached, it terminates the IIM browser and returns "-320" via command line interface. The default is no timeout.
4. Scripting Interface command timeout
The iimPlay command takes an optional timeout parameter:
i = iim1.iimPlay ("YourMacro", <timeout>)
This command is intended to watch the overall IIM run time and avoid any "hung" instances of IIM. If this timeout value is reached, the Scripting Interface terminates the IIM browser and returns "-2" via the Scripting interface. No extraction data is returned in this case. The default timeout value is 600s (10 minutes).
5. Note: You can also use and change the macro level timeout (#2) from the command line or Scripting Interface:
To do this, add to the macro:
SET !MACROTIMEOUT {{mytimeout}}
(a) In your script add the following line
i = iim1.iimSet ("-var_mytimeout", <timeout>)
Like with other IIM errors, the error text is available via iimGetLastError and extracted values are retrieved via iimGetLastExtract inside the calling script or program.
(b) From the command line interface you can do the same by using the switch: "-var_mytimeout <timeout>"
Page URL http://www.iopus.com/imacros/help/timeout.htm