SEPARATE> read NULL as zero
Moderators: JRL, Dorian (MJT support)
SEPARATE> read NULL as zero
Hi
usally when I use the separate command on an empty string Like this:
separate>string,;,vars
It result in vars_1=Null and vars_count=0
and I do an:
IF>vars_count>0
Do Stuff
endif
But now separate return vars_1=0 and therefore vars_count is =1 which screws up my if statement.
can i somehow define how macro scheduler shall read empty string
I'm using MS 8.0.1 demo
update: It only happens in one of my script's. Weird
usally when I use the separate command on an empty string Like this:
separate>string,;,vars
It result in vars_1=Null and vars_count=0
and I do an:
IF>vars_count>0
Do Stuff
endif
But now separate return vars_1=0 and therefore vars_count is =1 which screws up my if statement.
can i somehow define how macro scheduler shall read empty string
I'm using MS 8.0.1 demo
update: It only happens in one of my script's. Weird
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
It is obviously not an empty string. Try triming it:
VBSTART
VBEND
VBEval>Trim("%fubar%"),fubar
VBSTART
VBEND
VBEval>Trim("%fubar%"),fubar
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?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
I am unable to reproduce. Please can you post the code that does this?
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?
here goes:
YEAR>YYYY
MONTH>MM
DAY>DD
LET>TodaysDate=%YYYY%%MM%%DD%
IFFILEEXISTS>%logfile%
filedate>%logfile%,logfiledate
IF>LogFileDateTodaysDate
DeleteFile>%LogFile%
GOSUB>WriteLogFileHeader
Else
GOSUB>WriteLogFileHeader
ENDIF
ELse
GOSUB>WriteLogFileHeader
ENDIF
SRT>WriteLogFileHeader
GetDate>day
GetTime>timestamp
WRITELN>%logfile%,hej mand
WRITELN>%logfile%,*** ***
WRITELN>%logfile%,*** Acms Log File Created %day% @ %timestamp% ***
WRITELN>%logfile%,*** ***
WRITELN>%logfile%,*************************************************************
END>WriteLogFileHeader
Then i declare
Let>newfile=
YEAR>YYYY
MONTH>MM
DAY>DD
LET>TodaysDate=%YYYY%%MM%%DD%
IFFILEEXISTS>%logfile%
filedate>%logfile%,logfiledate
IF>LogFileDateTodaysDate
DeleteFile>%LogFile%
GOSUB>WriteLogFileHeader
Else
GOSUB>WriteLogFileHeader
ENDIF
ELse
GOSUB>WriteLogFileHeader
ENDIF
SRT>WriteLogFileHeader
GetDate>day
GetTime>timestamp
WRITELN>%logfile%,hej mand
WRITELN>%logfile%,*** ***
WRITELN>%logfile%,*** Acms Log File Created %day% @ %timestamp% ***
WRITELN>%logfile%,*** ***
WRITELN>%logfile%,*************************************************************
END>WriteLogFileHeader
Then i declare
Let>newfile=
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Your syntax is wrong. You have missed out the second parameter in WriteLn - the result variable. The value is being seen as the result variable, which is therefore being set to zero. Please look at the help for WriteLn - it takes this syntax:
WriteLn>filename,RESULT,value_to_write
WriteLn>filename,RESULT,value_to_write
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?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Sorry, I don't understand. The syntax is:
WriteLn>filename,result,outputvalue
result is the return code. You want:
WRITELN>%logfile%,RES,hej mand
WRITELN>%logfile%,RES,*** ***
WRITELN>%logfile%,RES,*** Acms Log File Created %day% @ %timestamp% ***
WRITELN>%logfile%,RES,*** ***
WRITELN>%logfile%,RES,*************************************************************
WriteLn>filename,result,outputvalue
result is the return code. You want:
WRITELN>%logfile%,RES,hej mand
WRITELN>%logfile%,RES,*** ***
WRITELN>%logfile%,RES,*** Acms Log File Created %day% @ %timestamp% ***
WRITELN>%logfile%,RES,*** ***
WRITELN>%logfile%,RES,*************************************************************
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?