Page 1 of 1 1
Topic Options
#180477 - 2007-09-12 09:37 PM Variable definitions in ScriptLogic Desktop authority
StarwarsKid Offline
Seasoned Scripter
*****

Registered: 2005-06-15
Posts: 506
Loc: Oregon, USA
I am trying to define a variable in Desktop Authority 7.61, but the "left" specification doesn't seem to register (but it does work in my basic Kixtart scripts).

 Code:
$PCdept = left($WkSta,2) 


$WkSta = NETBIOS computer name
Desktop Authority 7.61 uses Kixtart 4.53 as the underlying scripting engine.

BTW, SL said they don't support custom variables.....

Thank you for any advice, Matthew
_________________________
let the wise listen and add to their learning,
and let the discerning get guidance- Proverbs 1:5

Top
#180478 - 2007-09-12 09:41 PM Re: Variable definitions in ScriptLogic Desktop authority [Re: StarwarsKid]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
 Originally Posted By: StarwarsKid

BTW, SL said they don't support custom variables.....


Ummm .... LOL ?

Sorry, no advice, it should just work if 4.53 is the KiXtart version SL is based on,Period
On second thought if one can take their word, it might be even impossible to define a variable there!?


Edited by Jochen (2007-09-12 09:44 PM)
_________________________



Top
#180479 - 2007-09-12 09:43 PM Re: Variable definitions in ScriptLogic Desktop authority [Re: StarwarsKid]
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Don't think you'll get much help on Korg, re: SL. Did you post this on the SL boards ?

Only question I had is: When you say "doesn't seem to register" what do you mean by that ? Are you getting a syntax error when its run ? Do you even see syntax errors with SL ?

Top
#180485 - 2007-09-12 11:00 PM Re: Variable definitions in ScriptLogic Desktop authority [Re: Shawn]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
I would use @WKSTA
 Code:
BREAK ON
$PCdept = Left(@WKSTA,2)
"- " + $PCdept ?
Get $SO

Top
#180497 - 2007-09-13 01:25 AM Re: Variable definitions in ScriptLogic Desktop authority [Re: Witto]
StarwarsKid Offline
Seasoned Scripter
*****

Registered: 2005-06-15
Posts: 506
Loc: Oregon, USA
Jochen: Yeah, I know.

Shawn: I was prepared for that, but I'm glad there are some that try anyway. I haven't posted to the SL forum, it's slow and unexperience, you KORG guys are "IT" when it comes to Kixtart, therefore......

Sorry about the use of "register". What I mean is, SL doesn't seem to recognize the use of "left". There are no syntax errors, it just doesn't select the first two left characters.

The code I mentioned above returns any two characters in the workstation name that equal $PCdept.

If I have:
 Code:
$PCdept = "en" 
It will return all computers that have "en" in the name, not just those with "en" at the beginning. This is a problem when I have Engineering department computers that have EN430289 and another computer outside the Engineering dept that is named "Bagend".

SL recommended using message boxes to see what my variables generate. I know, you're laughing. *sigh*. At least when I go to the SL function library, I see almost every PRO's name from KORG. That's pretty cool.
http://www.scriptlogic.com/kixtart/functionlibrary_functionlist.aspx

WITTO: I'm going to try your syntax and see what happens. Thanks a lot!!
_________________________
let the wise listen and add to their learning,
and let the discerning get guidance- Proverbs 1:5

Top
#180503 - 2007-09-13 04:37 AM Re: Variable definitions in ScriptLogic Desktop authority [Re: StarwarsKid]
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Have you tried using an alternative like SUBSTR ...

$PCdept = substr(@WKSTA,1,2)


Top
#180595 - 2007-09-14 12:17 AM Re: Variable definitions in ScriptLogic Desktop authority [Re: Shawn]
StarwarsKid Offline
Seasoned Scripter
*****

Registered: 2005-06-15
Posts: 506
Loc: Oregon, USA
I did try using @WKSTA instead of the SL variable, that returns the correct characters (as the other method did) but I still need to test on a non-standard named PC.

Shawn: if the test doesn't work, I'll try using 'substr'. Thanks for the help!
_________________________
let the wise listen and add to their learning,
and let the discerning get guidance- Proverbs 1:5

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 259 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.058 seconds in which 0.023 seconds were spent on a total of 14 queries. Zlib compression enabled.

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