Technical support and scripting issues
Moderators: JRL, Dorian (MJT support)
-
armsys
- Automation Wizard
- Posts: 1108
- Joined: Wed Dec 04, 2002 10:28 am
- Location: Hong Kong
Post
by armsys » Wed Feb 02, 2011 10:20 am
Can some Macro Scheduler gurus enlighten me why MidStr doesn't get along with {pos(%tab%,%Item%)-1}?
Code: Select all
VBSTART
VBEND
VBEval>chr(9),tab
Let>Item=12345%tab%67890
Let>pos={pos(%tab%,%Item%)-1}
MDL>pos
MidStr>ItemCmd0_0,1,{pos(%tab%,%Item%)-1},result
-
Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
-
Contact:
Post
by Marcus Tettmar » Wed Feb 02, 2011 11:15 am
It's the extra commas. Confuses the parser for MidStr.
Anyway, you don't need that VBScript. V12 has %TAB% built in.
So you can just do:
Let>Item=12345%tab%67890
Let>x={pos(%tab%,%Item%)-1}
MidStr>Item,1,x,result
Or even quicker:
Let>Item=12345%tab%67890
Let>result={Copy(%Item%,1,pos(%tab%,%Item%)-1)}
-
Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
-
Contact:
Post
by Marcus Tettmar » Wed Feb 02, 2011 11:18 am
Or even:
Let>Item=12345%tab%67890
RegEx>^.*(?=\t),Item,0,results,numfound,0