SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
FORMAT for number can't be used

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
FORMAT for number can't be used
Author Message
Gary Jensen



Joined: 22 Mar 2000
Posts: 28

Post FORMAT for number can't be used Reply with quote

Windows 2000 Advanced server with 24x7 Scheduler 3.2.3
I am trying to create a JulianDate script library call.
It returns numbers between 1 and 366. I tried using
the "FORMAT number 000 number" for this, but it returns
a the number without padded zeros. I look at the script
log, and the command is working, but the leading zeros
are removed. I tried using FORMAT in the main script,
and get the same results. It pads the number, but when
I use the variable in the CONCAT, it removes the padded
zeros. Result below of ConcatEx should be "nrb020298"
but I get nrb02298.

110: FORMAT
110: Executing FORMAT("298", "0000", "298")

Return "0298"
111: CONCATEX
111: Executing CONCATEX("nrb", "02", "298", "")
112: CONCAT
112: Executing CONCAT("\\DOLIHPS3\dolpls\daily\alexs\", "nrb02298", "")

Return "\\DOLIHPS3\dolpls\daily\alexs\nrb02298"

Fri Oct 25, 2002 7:02 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7963

Post Re: FORMAT for number can't be used Reply with quote

You are using the very old syntax without quotes and commas which is only supported for compatibility with old versions.
With this syntax the second parameter is 0000 and it is treated as a number. As a result of that you don't get a fixed format string.

You should change your script to

FORMAT number, "0000", number
or
Format( number, "0000", number )
or even better
Format( number, "0000;0000", number )

: Windows 2000 Advanced server with 24x7 Scheduler 3.2.3
: I am trying to create a JulianDate script library call.
: It returns numbers between 1 and 366. I tried using
: the "FORMAT number 000 number" for this, but it returns
: a the number without padded zeros. I look at the script
: log, and the command is working, but the leading zeros
: are removed. I tried using FORMAT in the main script,
: and get the same results. It pads the number, but when
: I use the variable in the CONCAT, it removes the padded
: zeros. Result below of ConcatEx should be "nrb020298"
: but I get nrb02298.

: 110: FORMAT
: 110: Executing FORMAT("298", "0000", "298")

: Return "0298"
: 111: CONCATEX
: 111: Executing CONCATEX("nrb", "02", "298",
: "")
: 112: CONCAT
: 112: Executing CONCAT("\\DOLIHPS3\dolpls\daily\alexs\",
: "nrb02298", "")

: Return "\\DOLIHPS3\dolpls\daily\alexs\nrb02298"

Fri Oct 25, 2002 8:27 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.