Page 1 of 1 1
Topic Options
#126635 - 2004-09-13 09:42 PM Syntax can be a b**** - SHELL 'SET variable=###'
MACE Offline
Starting to like KiXtart

Registered: 2004-09-07
Posts: 150
Loc: Manchester UK
I am learning KiXtart and it is annoying how some of the little things can cause the biggest issues. Having spent many hours in the KIX2001 manual and in the forums and got no further; will someone tell me why neither of these set the environmental variables and what I need to do to be able to get them to work. Running on XP SP2

Option [1]
$OSN = @ProductType+" "+@CSD+"."
$PCSPEC = @CPU + " at " + @MHZ + "MHz "
$RAM=MemorySize(0)
$USERUID=UCASE(@USERID)

SHELL "SET OSN="+$OSN
SHELL "SET PCSPEC="+$PCSPEC
SHELL "SET RAM="+$RAM
SHELL "SET USERNAME="+$USERUID

Option [2]

SHELL "SET OSN=@OSN"
SHELL "SET PCSPEC=@PCSPEC"
SHELL "SET RAM=@RAM"
SHELL "SET USERNAME=@USERUID"


FUNCTION OSN()
$OSN = @ProductType+" "+@CSD+"."
ENDFUNCTION

FUNCTION PCSPEC()
$PCSPEC = @CPU + " at " + @MHZ + "MHz "
ENDFUNCTION

FUNCTION RAM()
$RAM=MemorySize(0)
ENDFUNCTION

FUNCTION USERUID()
$USERUID=UCASE(@USERID)
ENDFUNCTION

Top
#126636 - 2004-09-13 09:48 PM Re: Syntax can be a b**** - SHELL 'SET variable=###'
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
why not use kix's own set, setl, or setm commands?
Top
#126637 - 2004-09-14 12:21 AM Re: Syntax can be a b**** - SHELL 'SET variable=###'
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
When you "Shell" a set command it operates in that shell environment which is automatically closed (thus destroyed) after the KiXtart shell is completed.

As Bryce mentioned, you should use the native KiX Set commands.

Top
#126638 - 2004-09-14 12:29 AM Re: Syntax can be a b**** - SHELL 'SET variable=###'
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
There are a few lines in your script as well that don't sit right.

What are the two lines?
Option [1]
Option [2]
There are no such commands in KiX.

Also there is no such macro as @USERUID.
SHELL "SET USERNAME=@USERUID"
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#126639 - 2004-09-14 11:10 AM Re: Syntax can be a b**** - SHELL 'SET variable=###'
MACE Offline
Starting to like KiXtart

Registered: 2004-09-07
Posts: 150
Loc: Manchester UK
People - For CLARITY the Options[x] are for the benefit of this Board - NOT in the Script.
Option[0] if you will was the native SET command but it only appears to last for the duration of the kix script.
So I tried to get the result using Option[1] and then Option[2]. The UDF function @USERUID is Uppercase @USERID !

Top
#126640 - 2004-09-14 11:21 AM Re: Syntax can be a b**** - SHELL 'SET variable=###'
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
The '@' character is only valid for calling built-in macros.

To call user defined functions just use the function name, and I suggest that you adopt a naming convention to avoid namespace clashes with current and future KiXtart functions.

As regards your problem, look up the SET commands in the KiXtart manual - SETL, SETM etc.

Top
#126641 - 2004-09-22 08:43 PM Re: Syntax can be a b**** - SHELL 'SET variable=###'
MACE Offline
Starting to like KiXtart

Registered: 2004-09-07
Posts: 150
Loc: Manchester UK
The resolution to the problem proved simple , I installed kix2001 and things started to behave as expected.
Older version obviously did not like XP SP2 and gave ambiguous results.

NB: The set option now works as per the manual.

Thanks everyone

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 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.098 seconds in which 0.067 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