Page 1 of 1 1
Topic Options
#160047 - 2006-03-30 11:53 PM Surpress non Errors
JamesT Offline
Lurker

Registered: 2006-03-15
Posts: 4
Hi,
When i run my login script it works fine but for some reason i get another kix window come up and display a 0 to show there are no errors. Can someone remind me how to hide this, i done it before but i can no longer remember how.

Thanks
James

Top
#160048 - 2006-03-31 12:31 AM Re: Surpress non Errors
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Need to comb through your script, looking for function calls that return values, then silence them all, like this:

$= Close(1)

There is a FAQ on this as well.

-Shawn

Top
#160049 - 2006-03-31 06:09 PM Re: Surpress non Errors
JamesT Offline
Lurker

Registered: 2006-03-15
Posts: 4
I have tried adding in the command but without any joy, below is a snippet of the map netwrok drives code. Can you suggest where i should put this to kill off the second screen siplaying a 0

Code:

;==================================================================================================
;Map network drives
;==================================================================================================

Function MapDrives()
sleep 1
$RadioButton1.Value = 1
sleep 1
$RadioButton1.Value = 0
$RadioButton1.Enabled = 0
$RadioButton2.Value = 1

;DELETE ANY PREVIOUS MAPPINGS
Use "*" /DELETE

;Default Drives
If InGroup ("Domain Users")
USE H: @HOMESHR
USE M: "\\JTFS01-C\MPR"
USE P: "\\JTFS01-C\APPS"
USE Q: "\\JTFS01-C\DOCS"
USE S: "\\JTFS01-C\SHARED"
Endif

;Group Drives
If InGroup ("Domain Admins")
USE Z: "\\JTDC01\C$"
Endif

;User Drives
If @userid = "James"
USE Y: "\\JTDC02\C$"
Endif

;$_ = execute($Form.DoEvents(1))
execute($Form.DoEvents(1))
$ScriptProgressBar.PerformStep()
$RadioButton2.Value = 0
$RadioButton2.Enabled = 0
If @error = 0
$Label17.Text = ""
$Label17.Forecolor = 0,0,0
else
$Label17.Text = "Errors found when connecting network drives"
$Label17.Forecolor = 255,0,0
endif
sleep 4
EndFunction


Top
#160050 - 2006-03-31 10:01 PM Re: Surpress non Errors
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
execute($Form.DoEvents(1))

looks like it is the one causing the output.

Top
#160051 - 2006-04-01 02:10 AM Re: Surpress non Errors
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
Quote:


$= Close(1)





Doesn't it goes against recommendations using only '$' ? =)
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!

Top
#160052 - 2006-04-01 02:28 AM Re: Surpress non Errors
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
only with old versions of KiX.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#160053 - 2006-04-01 03:06 AM Re: Surpress non Errors
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Only my own personal pet peeve there ewook. I personally HATE it when other coders use it outside of Golfing.

Just about impossible to do a valid SEARCH / REPLACE of $ in a script. Using $_ would be so much better in my opinion or a real name that sort of gives some type of meaning as to why the var exists.

Most people though use the $ by it'self cause it's very quick and easy to type for a small 2 or 3 liner snippet of code. I on the other hand avoid it like the plague even with 3 liner code (but alas - I'm alone out in the deep sea with that I suppose)

 

Top
#160054 - 2006-04-01 01:16 PM Re: Surpress non Errors
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Nope. You are not alone Doc.
I also use real names for my variables just to see easily what the var might contain and by what it is filled.

Only for output that has no function in my scripts (suppressing the 0’s on screen for example) I use just $rc. Usually I go no shorter then $rc.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#160055 - 2006-04-01 03:29 PM Re: Surpress non Errors
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
I agree with you doc, I prefer to use $nul for code that I don’t need a result, if I need a result I to use names that are relative and often tied to the what I am trying to accomplish, I HATE cryptic variables.
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

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 847 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.058 seconds in which 0.024 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