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
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. |
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. | 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. | ||
− | '(c) 2008 iOpus | + | <nowiki> |
− | + | ' iMacros Get-Exchange-Rate Script | |
− | + | ' (c) 2008-2010 iOpus Software | |
− | + | ||
− | + | 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> |
Revision as of 14:28, 19 October 2012
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-2010 iOpus Software 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