| View previous topic :: View next topic |
| Author |
Message |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Mon Aug 29, 2005 12:10 am Post subject: [RESOLVED] need Help |
|
|
Hi, I'm here to ask help another time.....
why this dialog not close????
[code]
:RicercaDb
List Create,11
%%CercaIn = COGNOME
%r = 0
#Title Cerca
DIALOG CREATE,Ricerca Sched %1,-1,0,280,50,ONTOP,SMALLCAP
DIALOG ADD,STYLE,STYLE1,Arial,8,B,,BLACK
DIALOG ADD,EDIT,Id,6,39,215,19
DIALOG ADD,BUTTON,Cerca,28,149,64,20,Cerca,,DEFAULT
DIALOG ADD,BUTTON,Annulla,28,214,64,20,Annulla
DIALOG ADD,TEXT,TEXT1,9,3,38,14,Cerca,,STYLE1
DIALOG ADD,BITBTN,elenco,8,261,18,18,#CercaDb.bmp,,Visualizza l'elenco completo delle schede
DIALOG ADD,CHECK,Nome,27,39,104,18,Cerca Nominativo
DIALOG Show
:yLoop
Wait Event
%f = c@Event()
Dialog Close
While @Event()
Wend
Goto %f
........
.........
.......
[/code]
I call the function @RicercaDb() in other part of the script to find a record, but this dialog don't want close it
Please help me
Last edited by Tdk161 on Tue Aug 30, 2005 9:57 am; edited 1 time in total |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Mon Aug 29, 2005 1:53 am Post subject: |
|
|
i am guessing that your dialog is a second window and not your main one?
if that is correct then use
DIALOG SELECT, 1
DIALOG CLOSE, 1
the reason for the first line is that i have found that you can only close it if the window is active
serge _________________
|
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Mon Aug 29, 2005 1:55 am Post subject: |
|
|
and then use DIALOG SELECT, 0 to make active your main window
serge _________________
|
|
| Back to top |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Mon Aug 29, 2005 10:08 am Post subject: |
|
|
Thank serge but not work with dialog select,0
continue to be open and is a main dialog |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Mon Aug 29, 2005 10:34 am Post subject: |
|
|
to close the main dialog just use STOP
serge _________________
|
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Mon Aug 29, 2005 2:08 pm Post subject: |
|
|
TDK161,
I would suspect that the reason your dialog is not closing is because the logic in your loop is not exactly right. Lets walk through the loop to see what is going on here.
| Code: |
:yLoop
# Wait for an event to happen
Wait Event
# A event happend so put a c infront of the event name
%f = c@Event()
# Close the dialog
Dialog Close
# loop while @event() not equal to NULL
While @Event()
Wend
# When an event happens goto what ever value is in %f
# and not what ever the current event may be.
# So unless the user clicks the X in the upper right corner of the
# Dialog or the user sends a Alt+F4 keystroke then the Dialog
# will never close from a user clicking unless your button events have
# the STOP or Exit command in the sub-routine.
Goto %f |
Now if you don't have a sub routine called something like Serge was saying. Like the one below
| Code: |
:cCLOSE
# Using the Stop or Exit command will close the dialog
# The Stop command is an unconditional end of program
# This is Like opening the Taskmanager and Ending the task.
# It is better to use the Exit Command since Exit
# does a graceful end of program
Stop
|
| Code: |
:cAnnullaBUTTON
# Using the Stop or Exit command will close the dialog
# The Stop command is an unconditional end of program
# This is Like opening the Taskmanager and Ending the task.
# It is better to use the Exit Command since Exit
# does a graceful end of program
Stop
|
Bad Sub-Routines below and this is what I suspect is happening.
| Code: |
:cCLOSE
# If you have a goto yLoop in the cCLOSE sub routine
# Then the dialog will never close since Dialog Close only
# Sends the CLOSE event and it does not actually close
# the dialog window
goto yLoop
|
| Code: |
:cAnnullaBUTTON
# If Annulla means cancel and you have a goto yLoop
# in the cAnnullaBUTTON sub routine
# Then the dialog will never close since Dialog Close only
# Sends the CLOSE event and it does not actually close
# the dialog window
goto yLoop
|
The Dialog will never close since it is the main Dialog. The command Dialog Close should only be used on sub dialog (ie... secondary dialog windows) _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Tue Aug 30, 2005 9:55 am Post subject: |
|
|
Resolved
Many tahnks guyz
I 'Love' you  |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|