jhdvy
(Fresh Scripter)
2006-04-26 05:28 PM
Return codes

I would like to hide the output (zeros) for my printer migration. If searched the forums for examples and have not been able to find one that I fully understand. I see several references to using $RC = but I don't know what to put after $RC.

Example.

AddPrinterConnection ("\\server1\printer1")
AddPrinterConnection ("\\server1\printer2")
AddPrinterConnection ("\\server1\printer3")
If SetDefaultPrinter("\\server\printer")=0
$RC =

Thanks in advance for your help.


Les
(KiX Master)
2006-04-26 06:16 PM
Re: Return codes

Quote:

If searched the forums for examples...



The manual has many examples and I wrote a FAQ on it as well.


JochenAdministrator
(KiX Supporter)
2006-04-26 07:32 PM
Re: Return codes

you may have searched for the wrong keywords ...
look here : Why does the console display zeros and ones (amongst others)?


Mart
(KiX Supporter)
2006-04-26 10:12 PM
Re: Return codes

If you put $rc = before for example Open(1,"c:\somefile.txt",2). The return code from Open is placed in the $rc variable. You can check on the contents of $rc to see the result or you could just leave $rc alone and be done with it.