Page 1 of 1 1
Topic Options
#194339 - 2009-06-22 08:59 PM Wondering...
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Anyone have a clue what valid purpose the following code might have?
 Code:
Break On
Shell ("cmd.exe /c echo off")
It's at the start of every Kix script in a package that I was asked to review. I know the actual syntax is incorrect, and "cmd.exe" is not as flexible as %COMSPEC%, but why run "echo off" from a shell in a Kix script? Just wondering if I'm missing something that's not immediately obvious. To me, it's running a command that says "Echo is Off" and then exits.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#194340 - 2009-06-22 09:11 PM Re: Wondering... [Re: Glenn Barnas]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
You are right, it's not doing anything but turning off the echo for that one line... lol.... @echo off would have been better, but I bet they didnt think it work because of the @... and the parenthesis of course not needed... rofl...
Top
#194344 - 2009-06-23 12:44 AM Re: Wondering... [Re: Allen]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Looking further at the code, I wonder if they were trying to eliminate the return codes. \:D

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#194346 - 2009-06-23 09:05 AM Re: Wondering... [Re: Glenn Barnas]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
 Originally Posted By: Glenn Barnas
Looking further at the code, I wonder if they were trying to eliminate the return codes. \:D

Glenn


...or trying to suppress the output of later shelled commands.

I can't think of a valid use for it other than maybe testing for a working cmd.exe or as a kludgy way to initialise @ERROR

But I think that you probably have the right answer.

Top
Page 1 of 1 1


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 515 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.053 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.

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