I have reproduced the log file produced as the macro failed below.
Two message boxes popup one after the other, which have the following text and an "Ok" button.
The 1st reads:
"Incorrectly formed parameters"
and the second reads:
"3 not appropriate"
And then the macro stops.
I don't see the problem, and the messages don't seem to make any sense in this context.
Does anyone have a clue about this? The methods and code
I am using has been used successfully in other macros for a
long time now.
2/14/2006 11:19:32:636 - Started Macro : C:\Program Files\MJT Net Ltd\Macro Scheduler\Case Management\Cancel Transaction Entry.scp
2/14/2006 11:19:32:636 - // ************************************************************
2/14/2006 11:19:32:636 -
2/14/2006 11:19:32:636 - VBStart
2/14/2006 11:19:32:636 - VBEval>unescape("334Notes%20Entry*"),mywin
2/14/2006 11:19:32:636 -
2/14/2006 11:19:32:636 - Let>mypos={Pos("Notes","334Notes Entry*")}
2/14/2006 11:20:17:683 - Finished Macro : C:\Program Files\MJT Net Ltd\Macro Scheduler\Case Management\Cancel Transaction Entry.scp
2/14/2006 11:20:17:683 - Finished Macro : C:\Program Files\MJT Net Ltd\Macro Scheduler\Case Management\Test Open And Close All Case Mgt.scp
2/14/2006 11:20:17:683 - Finished Macro : A Case Management Master
Here is a snippet from the actual source code.
// ********************************
// ** Cancel Transaction Entry
// **
// ** This should work to cancel the add or edit mode of the
// ** similar transaction screens (notes, other1, other2,
// ** email, med specials, etc)
// **
// ** call it like this:
// ** Macro>Cancel Transaction Entry /mywin=Other 1 Entry*
// **
// *********************************
// Since parameters may contain the "/" character which is not
// allowed by macro scheduler syntax, the parameter is "escaped"
// prior to passing, and then "unescaped" to get it back to its
// original form
VBStart
VBEnd
VBEval>unescape("%mywin%"),mywin
Let>mypos={Pos("Notes","%mywin%")}
If>mypos>0
Let>Xcoord=NE001X
Let>YCoord=NE001Y
Endif
Problem with 7.4.009 complex expression ?
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Hi,
1) Syntax should be:
Let>mypos={Pos("Notes",%mywin%)}
2) Not sure why your comment says that "/" aren't allowed in Macro Scheduler syntax. Nothing wrong with them.
3) You will get problems if there is a " (double quote) character in the string since complex expressions use that to delimit the string. The solution is double quote:
StringReplace>mywin,","",mywin
I would add that line prior to the Pos line if you don't know what the string could contain. It avoids any issues with string delimiters inside the string.
4) But why don't you just do:
Pos>Notes,mywin,1,mypos
That avoids any problems with quote marks etc since it uses native Macro Scheduler syntax which doesn't care about string delimiters.
1) Syntax should be:
Let>mypos={Pos("Notes",%mywin%)}
2) Not sure why your comment says that "/" aren't allowed in Macro Scheduler syntax. Nothing wrong with them.
3) You will get problems if there is a " (double quote) character in the string since complex expressions use that to delimit the string. The solution is double quote:
StringReplace>mywin,","",mywin
I would add that line prior to the Pos line if you don't know what the string could contain. It avoids any issues with string delimiters inside the string.
4) But why don't you just do:
Pos>Notes,mywin,1,mypos
That avoids any problems with quote marks etc since it uses native Macro Scheduler syntax which doesn't care about string delimiters.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Why you can't pass "/" in parameters
If you are passing a variable as a parameter to another macro as in this example:2) Not sure why your comment says that "/" aren't allowed in Macro Scheduler syntax. Nothing wrong with them.
Macro>Cancel Transaction Entry /mywin=Other 1 Entry*
It will fail if your variable contains the "/" character like so:
Macro>Cancel Transaction Entry /mywin=Other / Misc
So, therefore it is neccessary to use a process which will change it to some other character, and the vbscript functions "escape" and unescape" do nicely for this.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Ah - that is true. I hadn't realised you were passing the values into another macro. I just thought you were were working in one macro and wondered why the comment.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?