#130037 - 2004-11-22 07:20 PM
three times a messagebox
|
Anonymous
Anonymous
Unregistered
|
When I run the next script, I get three!! times a messagebox. First the first, then the second and then THE FIRST AGAIN!! How come??????
Gosub test MessageBox ("second","test") Exit
:test MessageBox ("first","test") Return
|
|
Top
|
|
|
|
#130042 - 2004-11-22 09:38 PM
Re: three times a messagebox
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11631
Loc: CA
|
Hi Hans,
Even though GOTO and GOSUB are supported by KiXtart, in my opinion it would be better to craft your code so as to avoid the usage of those commands.
Something like this would only run when it was called and should end properly.
Code:
Dim $TestMsg
$TestMsg=DisplayMsg('This is a test of the message box from KiXtart')
If $TestMsg=1
? 'User selected OK'
Else
? 'User selected CANCEL'
EndIf
Function DisplayMsg($Message)
Dim $Msg,$MsgErr
$Msg=MessageBox($Message, 'Testing', 65)
$MsgErr=@ERROR
$DisplayMsg=$MsgErr
EndFunction
Edited by NTDOC (2004-11-22 09:51 PM)
|
|
Top
|
|
|
|
#130044 - 2004-11-22 09:55 PM
Re: three times a messagebox
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11631
Loc: CA
|
Nice little FAQ in such a short time there Les.
|
|
Top
|
|
|
|
#130045 - 2004-11-22 09:57 PM
Re: three times a messagebox
|
Lonkero
KiX Master Guru
   
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
|
|
Top
|
|
|
|
#130049 - 2004-11-23 12:58 AM
Re: three times a messagebox
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11631
Loc: CA
|
Okay a little tribute to the KF Master... but it's about time to quit hijacking this thread.
|
|
Top
|
|
|
|
#130050 - 2004-11-23 01:09 AM
Re: three times a messagebox
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11631
Loc: CA
|
|
|
Top
|
|
|
|
#130056 - 2004-11-23 04:20 PM
Re: three times a messagebox
|
Bryce
KiX Supporter
   
Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
|
Quote:
Bryce... what's your new MSN account?
should be bryce at isorg dot net.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1045 anonymous users online.
|
|
|