The renewal maintenance has officially ended for Progress iMacros effective November 30, 2023.
This Wiki site will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely, The Progress Team
Difference between revisions of "Get-Exchange-Rate.vbs"
Jump to navigation
Jump to search
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | This script calls demo macro Wsh-Extract-Rate in tray mode. It | + | This script calls demo macro Wsh-Extract-Rate in tray mode. It extracts exchange rate information and displays it to the user. |
− | '(c) | + | The same demo is also available as Visual Basic 6 (VB6) and [[CxxExamples|C++]] example. Please see "visualbasic-example.exe" in the iMacros example directory. |
− | + | ||
− | + | <nowiki> | |
− | + | ' iMacros Get-Exchange-Rate Script | |
− | + | ' (c) 2008-2015 iOpus/Ipswitch Inc. | |
− | + | ||
− | + | Option Explicit | |
− | + | ||
− | + | Msgbox ("This example will retrieve the current exchange rate for US$, EURO and GBP. This macro will run in the system tray.") | |
− | + | ||
− | + | ' find current folder | |
− | + | Dim myname, mypath | |
− | + | myname = WScript.ScriptFullName | |
− | + | mypath = Left(myname, InstrRev(myname, "\")) | |
− | + | ||
− | + | Dim iim1, iret, iplay | |
− | + | set iim1= CreateObject ("imacros") | |
− | + | ||
− | + | iret = iim1.iimOpen ("") | |
− | + | iret = iim1.iimDisplay("Extract Example") | |
− | + | iplay = iim1.iimPlay(mypath & "Macros\wsh-extract-rate.iim") | |
+ | |||
+ | Dim s | ||
+ | |||
+ | If iplay = 1 Then | ||
+ | s = "One US$ costs " + iim1.iimGetExtract(1) + " EURO or " + iim1.iimGetExtract(2) + " British Pounds (GBP)" | ||
+ | else | ||
+ | s = "The following error occurred: " + iim1.iimGetErrorText() | ||
+ | End If | ||
+ | |||
+ | MsgBox s | ||
+ | |||
+ | iret = iim1.iimClose | ||
+ | WScript.Quit(iret) | ||
+ | </nowiki> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Macro code for Wsh-Extract-Rate: | Macro code for Wsh-Extract-Rate: | ||
− | + | <nowiki> | |
− | + | TAB T=1 | |
− | + | TAB CLOSEALLOTHERS | |
− | + | URL GOTO=http://demo.imacros.net/Automate/ExtractDemo | |
− | + | 'Get the values | |
− | + | TAG POS=39 TYPE=TD ATTR=TXT:* EXTRACT=TXT | |
− | + | TAG POS=40 TYPE=TD ATTR=TXT:* EXTRACT=TXT | |
+ | </nowiki> |
Latest revision as of 18:05, 27 May 2015
This script calls demo macro Wsh-Extract-Rate in tray mode. It extracts exchange rate information and displays it to the user.
The same demo is also available as Visual Basic 6 (VB6) and C++ example. Please see "visualbasic-example.exe" in the iMacros example directory.
' iMacros Get-Exchange-Rate Script ' (c) 2008-2015 iOpus/Ipswitch Inc. Option Explicit Msgbox ("This example will retrieve the current exchange rate for US$, EURO and GBP. This macro will run in the system tray.") ' find current folder Dim myname, mypath myname = WScript.ScriptFullName mypath = Left(myname, InstrRev(myname, "\")) Dim iim1, iret, iplay set iim1= CreateObject ("imacros") iret = iim1.iimOpen ("") iret = iim1.iimDisplay("Extract Example") iplay = iim1.iimPlay(mypath & "Macros\wsh-extract-rate.iim") Dim s If iplay = 1 Then s = "One US$ costs " + iim1.iimGetExtract(1) + " EURO or " + iim1.iimGetExtract(2) + " British Pounds (GBP)" else s = "The following error occurred: " + iim1.iimGetErrorText() End If MsgBox s iret = iim1.iimClose WScript.Quit(iret)
Macro code for Wsh-Extract-Rate:
TAB T=1 TAB CLOSEALLOTHERS URL GOTO=http://demo.imacros.net/Automate/ExtractDemo 'Get the values TAG POS=39 TYPE=TD ATTR=TXT:* EXTRACT=TXT TAG POS=40 TYPE=TD ATTR=TXT:* EXTRACT=TXT