dm330
(Fresh Scripter)
2003-07-03 11:49 AM
KIX32 v4.20 doesn't print var?

Hi all,

Our logonscript shows drives and printers that are being installed, but if i want to use KIX32 version 4.20 (currently 4.12) all the var like for example:

? "The $printer is installed"

are not shown bij kix, then kix 4.20 shows:

? "The is installed"

mmmh...

anyone?


Howard Bullock
(KiX Supporter)
2003-07-03 01:16 PM
Re: KIX32 v4.20 doesn't print var?

What does VarTypeName($Printer) return? You may a problem somewhere else in your program that is not populating the variable.

dm330
(Fresh Scripter)
2003-07-03 02:43 PM
Re: KIX32 v4.20 doesn't print var?

The variable for example $printer works fine if i use kix 4.12, when i only replace the kix version to 4.20 the variable $printer is empty while it should say someting like \\server\printer

for drives it's someting like

Color n/n ? "$DriveLetter $Path"

It doesn't matter what variable i use they all stay emtpy?


Kdyer
(KiX Supporter)
2003-07-03 02:46 PM
Re: KIX32 v4.20 doesn't print var?

How about not encapsulating the vars in quotes?

For example, you have:

code:
? "The $printer is installed"

or..
code:
Color n/n ? "$DriveLetter $Path"

try this -

code:
? "The "+$printer+" is installed"

or..
code:
Color n/n ? $DriveLetter $Path

HTH,

Kent


Sealeopard
(KiX Master)
2003-07-03 02:50 PM
Re: KIX32 v4.20 doesn't print var?

Without seeing the script, it's hard to help. There are a couple of reasons why this happens, e.g. variable scope issues. Also, please do not use variables embedded inside strings. You could also try
code:
? 'vartype(printer)     = '+vartype($printer)
? 'vartypename(printer) = '+vartypename($printer)
? 'printer = '+$printer
? 'The $printer is installed'



Howard Bullock
(KiX Supporter)
2003-07-03 02:51 PM
Re: KIX32 v4.20 doesn't print var?

As I stated previously, your code may work with 4.12 but may not be setting the $printer variable correctly under 4.20.

So please use Vartypename() to validate your variable when it is assigned to insure that you are getting what you think you should be getting under 4.20.


Les
(KiX Master)
2003-07-03 02:52 PM
Re: KIX32 v4.20 doesn't print var?

Are you sure about the versions?
quote:
- Added NoVarsInStrings option. If this option is ON, variables inside strings
are not resolved.



dm330
(Fresh Scripter)
2003-07-03 02:55 PM
Re: KIX32 v4.20 doesn't print var?

well the printers and the drives are all connected during the script, the only thing i don't have is the text on the screen?

Sealeopard
(KiX Master)
2003-07-03 02:58 PM
Re: KIX32 v4.20 doesn't print var?

So, did you try our suggestions and check the vartype?
Please report back with the vartype results and/or post your script.


Howard Bullock
(KiX Supporter)
2003-07-03 03:01 PM
Re: KIX32 v4.20 doesn't print var?

If you have valid data when the variable is assigned, check it again just before printing it to the screeen.

dm330
(Fresh Scripter)
2003-07-03 03:11 PM
Re: KIX32 v4.20 doesn't print var?

tryed most of the sug to setting the variable to "the printer "+$printer+"" and so on but i dont't even get the part of "the printer" text so i think i have to use the other sug like the vartype(). wil get back here when i have worked all the sug out...

tnx all


Sealeopard
(KiX Master)
2003-07-03 03:14 PM
Re: KIX32 v4.20 doesn't print var?

So, now you're saying you don't get any output at all? [Confused] This sounds different from what you talked about before.

It could indicate a script failure at a point before the printing section. Put a DEBUG ON into the first line of your code and step through the code in order to detect the failing line.

Oh, and the reaosn we make suggestions is that you DO give them a try and report back so that we can help you effectively.


LonkeroAdministrator
(KiX Master Guru)
2003-07-03 04:15 PM
Re: KIX32 v4.20 doesn't print var?

jens, just relax and wait his response.
bet everything is ok but having some weird dim- or similar issue there...


dm330
(Fresh Scripter)
2003-07-05 12:58 AM
Re: KIX32 v4.20 doesn't print var?

Have put in a part of the script here:

:ConnectDrive
USE $DriveLetter $Path

DEBUG ON
If SETOPTION("NoVarsInStrings", "OFF") = 0 Endif
? "TEST"
? "the printer $DriveLetter $Path"
Vartype($Driveletter)

If @ERROR = 0
Color n/n ? "the printer $DriveLetter $Path"
Else
If SetConsole ("SHOW") = 0 Endif
Color r+/n ? ? "Warning the following drive failed to connect:" ? "$DriveLetter $Path" ?
Sleep 5
Endif

DEBUG OFF

This part is printed correct the first time.
? "TEST"
? "the printer $DriveLetter $Path"

After the "If @ERROR = 0" part nothing is printed anymore and because i give a loop in the script everything including the ? "TEST" part is not printed anymore after the first loop.

The VarTypeName($Printer) returns 8, that would be a string.

The drive letter and the path i get out of a query script like this:

[Global Group]
Drive1="M: \\server01\sharename"
Drive2="Q: \\server02\sharename"

Downloaded the latest version from here 4.20 just to be sure. same results :-(

hope this helps a bit...

[ 04. July 2003, 13:03: Message edited by: dm330 ]


Howard Bullock
(KiX Supporter)
2003-07-04 01:12 PM
Re: KIX32 v4.20 doesn't print var?

Please show us more of your script including the the code where you read your INI file and split the string into $DriveLetter and $Path. Infact show us all your code and it would be much easier for us to help.

dm330
(Fresh Scripter)
2003-07-04 01:18 PM
Re: KIX32 v4.20 doesn't print var?

[Mad] saaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah!!! [Mad]

i think something changed between 4.12 and 4.20 with this part if you would use COLOR:
Color n/n ? "the printer $DriveLetter $Path"

Because if i only print:
? "the printer $DriveLetter $Path"

everthing works fine... [Eek!]

mmmh bugger

well tanx again for all the help guys

greetz from the Netherlands and have a nice weekend [Big Grin]


LonkeroAdministrator
(KiX Master Guru)
2003-07-04 01:19 PM
Re: KIX32 v4.20 doesn't print var?

also, I must ask the code also as there is no loop code given.

oh, and remove all these:
If SetConsole ("SHOW") = 0 Endif

and setoption things from the execution part.


dm330
(Fresh Scripter)
2003-07-04 02:01 PM
Re: KIX32 v4.20 doesn't print var?

see above

i worked it out...

It was the COLOR statement...

but tnx anyhow

[Big Grin]


LonkeroAdministrator
(KiX Master Guru)
2003-07-04 02:20 PM
Re: KIX32 v4.20 doesn't print var?

I saw it ofcourse.
but still my comments stay.

and even though you are glad now that your script runs, you should be considered why it didn't run before.


dm330
(Fresh Scripter)
2003-07-04 02:45 PM
Re: KIX32 v4.20 doesn't print var?

If i try to post the script it says:

Sorry, we do not permit this HTML tag: Parenthesis in HTML tag

???

[Confused]

Well yes that's true...

If you read the 4.20 manual, it stat's

New commands, functions, macros

Enhanced commands, functions
COLOR COLOR now accepts variables as input.

So they did change something?

Well i can't use COLORS anymore, because then i can't print any text...

I think it's that you can use $var with the COLOR option and you have
to close it somehow before you can print something to the screen?

[ 04. July 2003, 14:49: Message edited by: dm330 ]


Richard H.Administrator
(KiX Supporter)
2003-07-04 04:20 PM
Re: KIX32 v4.20 doesn't print var?

I'm not surprised you are not seeing anything.
quote:
Color n/n ? "the printer $DriveLetter $Path"
The "n" in the color statement refers to "normal", which is black.

You are printing black text on a black background, and that makes it kinda hard to read [Wink]


LonkeroAdministrator
(KiX Master Guru)
2003-07-04 11:52 PM
Re: KIX32 v4.20 doesn't print var?

eh...
normal is for black?
like, n=black text/n=black background...

should use more console stuff to remember these.
good pick anyway there howarth.


dm330
(Fresh Scripter)
2003-07-07 08:37 AM
Re: KIX32 v4.20 doesn't print var?

mmmmmmmmmmmmh!

know i,am feeling really stupid [Roll Eyes]

quote
I'm not surprised you are not seeing anything.

But the strange thing is that i see the printout corectly with kix4.20 with the color n/n black/black in gray-style?

Owkay then [Big Grin]

well tanx for all the support here guys... [Smile]

[ 07. July 2003, 08:38: Message edited by: dm330 ]