View previous topic :: View next topic
|
Author |
Message |
boyti ko
New User
Joined: 03 Nov 2014 Posts: 78 Location: Malaysia
|
|
|
|
Hi,
I'm trying to call a PCOMM macro inside another PCOMM macro. But having this error: Variable is undefined: 'test_macro'.
Both macros are in the same folder.
Please help me to point out on how to do it correctly.
This is the macro I used to call another macro.
The "test_macro" is another macro which is working normal on its own.
Code: |
[PCOMM SCRIPT HEADER]
LANGUAGE=VBSCRIPT
DESCRIPTION=
[PCOMM SCRIPT SOURCE]
OPTION EXPLICIT
autECLSession.SetConnectionByName(ThisSessionName)
REM This line calls the macro subroutine
subSub1_
sub subSub1_()
call test_macro
end sub |
This is what I found in the manual.
Call Statement
Description - Transfers control to another macro file. When the Exit command in the second macro file is encountered, execution returns to the command that follows Call statement Up to 10 levels of macro files can be called
Syntax : Call MacroFilename
I'm using Quick3270™ Macro Language Reference Manual Version 4.52 as a reference. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
So "test_macro" is stored in the directory without any extension? If it has an extension, you need to either remove the extension so the call can find the macro file, or add the extension to the call statement filename. |
|
Back to top |
|
|
boyti ko
New User
Joined: 03 Nov 2014 Posts: 78 Location: Malaysia
|
|
|
|
Hi Robert,
Thanks for your reply.
I have followed your advice. Initially, both macro have the extension of .mac
I tried removing the extension of test_macro in the directory then run the same macro I posted above.
Then I also tried putting the .mac extension in both of the file and inside the macro.
Both still resulted in the same error of - Variable is undefined: 'test_macro'.
Would I be needing to declare something? |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2598 Location: Silicon Valley
|
|
|
|
Quote: |
I'm using Quick3270™ Macro Language Reference Manual Version 4.52 as a reference. |
Can you clarify the environment?
What I gleaned from that manual: PCOMM macros will work in the Quick3270 emulator.
But I doubt there is a similar statement that Quick3270 macros will run in the PCOMM emulator. You should refer to the PCOMM manual. |
|
Back to top |
|
|
boyti ko
New User
Joined: 03 Nov 2014 Posts: 78 Location: Malaysia
|
|
|
|
Hi Pedro,
First of all, let me thank you. Recently, I have read your 'Share in Orlando' and help me lot in my last activity.
Back to the topic at hand, I'm doing it on PCOMM. It says here that it is version 6.0. This is the closest I got when checking the PCOMM manual. link but I still didn't figure out how to use the "Start Playing Macro (110)" indicated there.
Since the language indicated at the header is VBSCRIPT, I also tried doing this, but it seems it's only for .vbscript and not for .mac
Code: |
[PCOMM SCRIPT HEADER]
LANGUAGE=VBSCRIPT
DESCRIPTION=
[PCOMM SCRIPT SOURCE]
OPTION EXPLICIT
autECLSession.SetConnectionByName(ThisSessionName)
dim ObjShell
Set objShell = CreateObject("WScript.Shell")
ObjShell.Run "cscript \\C:\ProgramData\IBM\Personal Communications\test_macro.mac"
|
If I map the keyboard, I can assign the PLAY function. The assigned key will have [Play]. I was thinking that after the PLAY function work, I just need to select the correct macro from there or maybe even have a parameter to accept what macro I want to run.
Out of curiosity, I even tried using these commands but still unable to do it.
Code: |
autECLMacro "[Play]" |
Code: |
autECLSession.autECLPS.SendKeys "[Play]" |
|
|
Back to top |
|
|
|