Page 1 of 1 1
Topic Options
#133215 - 2005-02-01 12:57 PM script cut's the zero
Anonymous
Unregistered



Hi

I have a problem with my script. I wannt to create a monthly report but the script, it doesn't matter if I take the run or the shell command, cut's the zero in the @monthno variable.


Run "vhistexp.exe '@monthno' + '*' + '@year' + '.log'"

and so I get this output

vhistexp.exe 1*2005.log

but i want the output with the zero first like this

vhistexp.exe 01*2005.log

Have anybody an idea how i can make it better

Thanks Jimmy

Top
#133216 - 2005-02-01 02:42 PM Re: script cut's the zero
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Sure, just create your own @MONTHNO called $MONTHNO, like this:

$MONTHNO = IIF(@MONTHNO<10, "0"+@MONTHNO, @MONTHNO)

Then use/show it like this:

? "vhistexp.exe " + $MONTHNO + "*" + @year + ".log"

-Shawn

Top
#133217 - 2005-02-01 04:00 PM Re: script cut's the zero
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Or even:
Code:
? "vhistexp.exe " + Right("0"+@MONTHNO,2) + "*" + @year + ".log"



Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 580 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.141 seconds in which 0.084 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org