Page 1 of 1 1
Topic Options
#59999 - 2001-10-19 10:34 PM Variables and Zero
Anonymous
Unregistered


Hello, I am trying to set a variable in a script that starts with 0, however it rips the zero(s) off when I try to use the variable. See my example script
---------------------------------------------
$var=00333
IF @INWIN="1" GOTO "WINNT" ELSE GOTO "END"

:WINNT
?"Setting System Variables..."
SETM "TEMP=c:\TEMP"
SETM "TMP=c:\TEMP"
SETM "SERVERNAME=NT$var"
SETM "DOMAINNAME=NTDOM$var"
SETM "NOTESNAME=NT$var"
:END
---------------------------------------------
This will result in the following:
Servername = NT333
Domainname = NTDOM333
Notesname = NT333

For some reason, it removes the zero(s). Any assistance would be great!

Thanks,
Blake

Top
#60000 - 2001-10-19 11:19 PM Re: Variables and Zero
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Try:

$var="00333"

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#60001 - 2001-10-19 11:32 PM Re: Variables and Zero
Anonymous
Unregistered


let me reply , let me reply !!!
$var="00333" instead of $var=00333

Top
#60002 - 2001-10-19 11:33 PM Re: Variables and Zero
Anonymous
Unregistered


That worked Les. I was thinking it would add the " " in the variable, but it didn't.

Thanks for your assistance!

Top
#60003 - 2001-10-20 05:24 AM Re: Variables and Zero
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Now, now, novastar... I beat you by a mile...

Well, 13 minutes anyway.

I'll let you have the next easy one... but don't doddle.

Blake,
Wrapping it in quotes forces it to be a string instead of a numeric value.

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 2082 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.056 seconds in which 0.028 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