Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro parameters

Status
Not open for further replies.

MJGC

Programmer
Joined
Apr 7, 2002
Messages
7
Location
US
Hi,

Could you somebody provide me an example to run a macro with parameters when I use Command$ in the macro source, please?

Thanks in advanced,

MJGC
 
Hi,

Here is a sample of a macro which has a transformer model name passed to it. It is run from dos using the following command line:

c:\progra~1\cognos\cer1\bin\runmac32.exe c:\bi\macros\mdl_to_pyi.mcx "test"

The macro name is mdl_to_pyi.mac with the model name being test.

NB I have not made a spelling mistake, the macro name is the complied mcx file.

********* Start Macro ********

sub main()
dim xferapp as object
dim xfermod as object
dim xferpath as string
dim modelname as string

xferpath = "c:\bi\models\"
modelname = Command$

set xferapp = createobject("cognostransformer.application")
set xfermod = xferapp.openmodel(xferpath & modelname & ".mdl")

xfermod.saveas xferpath & modelname & ".pyi"
xfermod.close

set xrefmod = nothing
set xrefapp = nothing
exit sub


********* End Macro ********



Hope it is of some help


Kevin **************************************************************
The difference between fiction and reality is that fiction has to make sense.
**************************************************************
 
Hi Kevin,

This is I needed. Thank you very much.

Best regards,

María José
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top