Ryan
(Fresh Scripter)
2003-10-10 02:09 PM
Hide is hide, right?!

Hello scripters,

In the following example, I see a strange console behavior.

If I start this script, with wKiX32.exe and no -i switch, the console is invisible for 4 seconds, then appears very quick and is then invisible for another 2 seconds. After that the console is visible as aspected.

But in my opinion it should not appear after 4 seconds from start. If I take away "1" ?, the console doesn't show up, but hide is hide, right?!

code:
Sleep 2
$intRC = SetConsole("Hide")
Sleep 2
"1" ?

Sleep 2
$intRC = SetConsole("Show")
Sleep 2
"2" ?

Get $

Kind regards,
Ryan


MightyR1
(MM club member)
2003-10-10 02:17 PM
Re: Hide is hide, right?!

I guess this is by design...

running wkix without -i hides the console unless you generate console output. The "1"? does this and therefore the flashing box...

See what happens if you remove "1"?, "2"? and the $intRCs... It should flash since setconsole returns a value.


Ryan
(Fresh Scripter)
2003-10-10 02:36 PM
Re: Hide is hide, right?!

If I start the same script with KiX32.exe, a console appears for 2 seconds, is then invisible for 4 seconds. So this is normal, it doesn't show up, after I hide the console with the function SetConsole("Hide"). And that's how it should work. Hide is hide, right?!

SetConsole("Hide") should hide the console, no mather what.
SetConsole("Show") should show the console.


MightyR1
(MM club member)
2003-10-10 02:46 PM
Re: Hide is hide, right?!

Ryan,

I was right [Razz]

From the manual:
quote:
KiXtart 2001 is provided in two ‘flavors’: the standard console-based version and a Windows version. The Windows version will only display a console if and when any output is sent to the screen. If desired, this behavior can be overridden using the /I (Invisible) commandline option.
Since the setconsole and the ""? return values, and your not using the -i, this behaviour is by design. (It has nothing to do with setconsole, but with wkix32...)


Sealeopard
(KiX Master)
2003-10-10 03:32 PM
Re: Hide is hide, right?!

Yes, correct code behavior and fully documented in the KiXtart Manual.

Ryan
(Fresh Scripter)
2003-10-11 10:27 AM
Re: Hide is hide, right?!

Yes I know what the manual says. I have it hanging above my bed. [Wink]

But what should SetConsole("Hide") do in your opinion?

Please, also try the code before you place your theories. Try it with both KiX32 and wKiX32, without -i.


LonkeroAdministrator
(KiX Master Guru)
2003-10-11 03:43 PM
Re: Hide is hide, right?!

yep.
boys boys.

Ryan,
indeed, when you use setconsole in wkix32, you are creating the console.
the console is not even there in wkix32 unless you use it.
with setconsole, you tell kixtart to do something with it, thus it does create it, then looks what it should do with it.
in this case hide.
thus you are creating the console to hide it.

your comment about:
"1" ?
I don't get.
it does not affect at all as the console is shown and once before.


Les
(KiX Master)
2003-10-11 04:01 PM
Re: Hide is hide, right?!

Jooel is right. You create the console by trying to hide it. Better to simply not create the console at all. Then you will not have to hide it.

MightyR1
(MM club member)
2003-10-11 11:08 PM
Re: Hide is hide, right?!

Like I said...

Setconsole returns a value which is displayed when using wkix32 without -i...


Les
(KiX Master)
2003-10-11 11:20 PM
Re: Hide is hide, right?!

Patty,
I beg to differ... SetConsole() does return a value, but the value is handled. WKiX simply creates the console before hiding it. I find this to be an annoyance and think that for WKiX the default for the console should be hidden and should have to be explicitly set to show it.


MightyR1
(MM club member)
2003-10-11 11:33 PM
Re: Hide is hide, right?!

It should, but it doesn't. So... Let's stop 'fighting', we're both right!

LonkeroAdministrator
(KiX Master Guru)
2003-10-12 12:56 AM
Re: Hide is hide, right?!

sorry pat, you wrong.
he handled the return value.
it does not matter does it return something or not.
simple call for setconsole will always create console to be able to hide it.


Les
(KiX Master)
2003-10-12 12:59 AM
Re: Hide is hide, right?!

yeah Patty... you're wrong. [Frown]

MightyR1
(MM club member)
2003-10-12 11:44 PM
Re: Hide is hide, right?!

I know,

but I hate it when I'm wrong (or loose)...
[Mad] [Mad] [Mad] [Mad] [Mad]


LonkeroAdministrator
(KiX Master Guru)
2003-10-13 12:28 AM
Re: Hide is hide, right?!

hehee.
don't worry pat, I still love you even though you not perfect bastmorta! [Wink]


MightyR1
(MM club member)
2003-10-13 07:41 AM
Re: Hide is hide, right?!

Seen that BASTA thingie around lately...

What did I miss???


Ryan
(Fresh Scripter)
2003-10-13 11:31 AM
Re: Hide is hide, right?!

Hi,

Thanx for your comment!

Lonkero I know it's just a stupid sample script, just playing around.

Since the -i switch came i've registered .KiX to open with wKiX32.exe and that switch. Sometimes I want a console. So I've more enteries on that registry key. But i want to control it in the script, console or consoleless.

But I've found out what creates the unwanted console in my wanted consoleless scripts. If i start writing a script, i copy all the SetConsole and SetOption options from a default script template. And it's the SetOption("WrapAtEOL", "ON"), that creates a console just there in a blink of an eye. Solution: take it out there! it's not needed in a consoleless script.

Sample:
code:
$intRC	= SetConsole("Hide")
Sleep 1
$intRC = SetOption("WrapAtEOL", "ON")
Sleep 1
Get $

Groetjes Ryan


LonkeroAdministrator
(KiX Master Guru)
2003-10-13 02:17 PM
Re: Hide is hide, right?!

you mean your setconsole("hide") does not do it?
if not, could you tell me your kix-version as in all versions that makes the console.


Ryan
(Fresh Scripter)
2003-10-13 04:20 PM
Re: Hide is hide, right?!

Hi Lonkero,

Both 4.22 Release Candidate 1 and 4.21. W2K Pro UK, SP4.

In the sample from this morning, the console is hidden for 1 second. And then popups and disappears very quick, at the SetOption("WrapAtEOL", "ON") function. I mean the console doesn't stay there, I can see it flashing and that's what i find strange. But it's NOT on the SetConsole("Hide") function.

Do you experience something different? Play around with the code, make the 2 Sleep's 3 seconds, or leave a line out of it.

Please don't tell me it's only me! [Big Grin]


LonkeroAdministrator
(KiX Master Guru)
2003-10-13 05:32 PM
Re: Hide is hide, right?!

actually, it seems that setconsole does not anymore create the console. if it has ever done it.
sleep 5 ;wait for kix to start fully 
$=setconsole("hide") ;get the flash
"some output to verify the console is really hidden"
sleep 2


Les
(KiX Master)
2003-10-13 05:36 PM
Re: Hide is hide, right?!

Does that mean I have to apologize to Patty? [Embarrassed]

...tonight's menu is crow a la king


LonkeroAdministrator
(KiX Master Guru)
2003-10-13 06:57 PM
Re: Hide is hide, right?!

no, it does not mean as patty was still wrong.
he just quessed what was going instead of investingating it.

[ 13. October 2003, 18:57: Message edited by: Lonkero ]


MightyR1
(MM club member)
2003-10-13 10:51 PM
Re: Hide is hide, right?!

So I was wrong heh???

try this:
Beep
;J's test code --> flashes
Sleep 2
$=SetConsole("hide")
"some output to verify the console is really hidden"
Sleep 2
Play "1g2d600f600f600f6d400f"


then this:
Beep
;Patty's 1st test code --> hidden
Sleep 2
$=SetConsole("hide")
;"some output to verify the console is really hidden"
Sleep 2
Play "1g2d600f600f600f6d400f"



and finally this:
Beep
;Patty's 2nd test code --> flashes
Sleep 2
SetConsole("hide")
;"some output to verify the console is really hidden"
Sleep 2
Play "1g2d600f600f600f6d400f"


My results:
  • $=setconsole with a "bla" --> flash
  • $=setconsole without "bla" --> no flash
  • setconsole without "bla" --> flash
Hmmm,
why do I doubt my brain... [Razz]


LonkeroAdministrator
(KiX Master Guru)
2003-10-13 10:54 PM
Re: Hide is hide, right?!

patty, there is no console output in your test code.
so, it does not fit.
you add output after the hide, it surely does flash.


MightyR1
(MM club member)
2003-10-13 10:57 PM
Re: Hide is hide, right?!

In my second test code there is console output!!!

Investigate and see that the setconsole can be the only command generating the output...Therefore flashing screen.


LonkeroAdministrator
(KiX Master Guru)
2003-10-13 11:01 PM
Re: Hide is hide, right?!

you still don't listen to me.
your code:
Beep
;Patty's 1st test code --> hidden
Sleep 2
$=SetConsole("hide")
"some output to verify the console is really hidden"
Sleep 2
Play "1g2d600f600f600f6d400f"



does flash.
you just commented out that output line after setconsole-hide to prove something...
dunno what.


MightyR1
(MM club member)
2003-10-13 11:17 PM
Re: Hide is hide, right?!

In my first test code the "" text is commented, not uncommented... (your last code = your own)

What I'm trying to prove is that setconsole generates a dos box if the return value is not 'catched' in a variable, just like the manual said it would.


macIntozAdministrator
(Administrator)
2003-10-13 11:21 PM
Re: Hide is hide, right?!

k, and I was just stating that it needs to have visible console to hide it.
like, you will end up with flashing window if you trust to setconsole in wkix32.

that's why simple:
$=redirectoutput("%temp%\mytrash.dat")

does the job the best.


Sealeopard
(KiX Master)
2003-10-13 11:25 PM
Re: Hide is hide, right?!

quote:
setconsole in wkix32
is an oxymoron as the reason you're using WKIX32 is to NOT have the console in the first place. Secondly, if you do use WKIX32, then why do you want to generate cosole output. These things are all mutually exclusive and more indicative of sloppy coding practices.


MightyR1
(MM club member)
2003-10-13 11:27 PM
Re: Hide is hide, right?!

Agreed, but the topic started saw a "strange" setconsole behaviour.

I tried to show it's not strange, but by design [Wink]


macIntozAdministrator
(Administrator)
2003-10-13 11:27 PM
Re: Hide is hide, right?!

not exclusively.
I do have some tasks where I want to see also console stuff as kix has no pipe.


Sealeopard
(KiX Master)
2003-10-13 11:33 PM
Re: Hide is hide, right?!

REDIRECTOUTPUT is the piping equivalent in KiXtart.

macIntozAdministrator
(Administrator)
2003-10-13 11:39 PM
Re: Hide is hide, right?!

so how do you pipe with it stuff from as example telnet window?

Sealeopard
(KiX Master)
2003-10-13 11:46 PM
Re: Hide is hide, right?!

You're now hijacking the thread with an unrelated issue. You can send information via Telnet as outlined e.g. in Sendmail() - send mail with telnet . Or use a telnet-COM-component. Or, even better, start a new threat in which you outline your exact requirements with regards to interfacing with Telnet.

Ryan
(Fresh Scripter)
2003-10-14 11:25 AM
Re: Hide is hide, right?!

I see that many give facts as comments. I'd love to see opinons. That's totaly different! To improve is let the old idea's go, and find new one's. (sorry Bill G. [Big Grin] )

I find the flash irritating. I hope we can suggest an improvement here.

Here's another small sample, where it doesn't flash on the comment, but on the SetOption. Wouldn't it be nice if it didn't flash at all? From the moment you state "Hide" till the moment you state "Show", it should be hidden. For those who like the flash, maybe SetConsole("Flash") is a nice suggestion. [Razz]

code:
$ = SetConsole("Hide")
$ = SetOption("WrapAtEOL", "ON")
Sleep 2

;Let my program do some stuff...

$ = SetConsole("Show")
Sleep 2
;At this point i want some interaction with the program...

"This is a very very looonnnnnggggggg line, just to see if it wraps at the end of the line."
Sleep 2

Jens, we all have our own purposes.


LonkeroAdministrator
(KiX Master Guru)
2003-10-14 11:37 AM
Re: Hide is hide, right?!

full control over the console indeed would be nice.
maybe even setconsole("destroy") and setconsole("create")
this way we don't need to reserve space for console-memory.
also the redirectoutput should not require console at all.

and jens, sure it was not unrelated.
console output in some scripts are really needed but one does not want the console to show for ever.
your comment about telnet is irrelevant as telnet was stated just as an example.