Hints, tips and tricks for newbies
Moderators: JRL, Dorian (MJT support)
-
hoangvo81
- Pro Scripter
- Posts: 69
- Joined: Tue Feb 07, 2012 8:02 pm
Post
by hoangvo81 » Mon Sep 30, 2013 4:56 pm
Hi,
Can someone pinpoint whats wrong with the following?
I m trying to find if the string (path) contains the folder which has this month.
Code: Select all
month=thismonth
year=thisyear
let>folder=\\cab1\cab2\cab3\cab4\cab5 bke\cab6 new\09.01.2013
position>thismonth,folder,1,mRst
position>thisyear,folder,1,yRst
if>{(%mRst%>0) and (%yRst%>0)}
'found folder of this month
mdl>%folder%
endif
if i manually enter 09 and 2013 it works fine.
Code: Select all
month=thismonth
year=thisyear
let>folder=\\cab1\cab2\cab3\cab4\cab5 bke\cab6 new\09.01.2013
position>09,folder,1,mRst
position>2013,folder,1,yRst
if>{(%mRst%>0) and (%yRst%>0)}
'found folder of this month
mdl>%folder%
endif
-
JRL
- Automation Wizard
- Posts: 3529
- Joined: Mon Jan 10, 2005 6:22 pm
- Location: Iowa
Post
by JRL » Mon Sep 30, 2013 5:09 pm
Rather than Month= and Year= try Month> and Year>.
I've done this too with Month>, Day> and Year>.
-
hoangvo81
- Pro Scripter
- Posts: 69
- Joined: Tue Feb 07, 2012 8:02 pm
Post
by hoangvo81 » Mon Sep 30, 2013 5:10 pm
Found the problem.
was coding in vb and realize...
month=thismonth
should have been month>thismonth
same with year.
ignore this post
-
hoangvo81
- Pro Scripter
- Posts: 69
- Joined: Tue Feb 07, 2012 8:02 pm
Post
by hoangvo81 » Mon Sep 30, 2013 5:12 pm
JRL wrote:Rather than Month= and Year= try Month> and Year>.
I've done this too with Month>, Day> and Year>.
Thanks JRL,
i found that out after reviewing it via the debugger line by line.