New topic: 

Stopping function

<http://forums.realsoftware.com/viewtopic.php?t=32203>

       Page 1 of 1
   [ 4 posts ]                 Previous topic | Next topic         Author  
Message       cliophoto           Post subject: Stopping functionPosted: Tue 
Jan 26, 2010 11:47 pm                        
Joined: Sat Nov 14, 2009 7:50 pm
Posts: 15
Location: Nova Scotia in the summer Or Southern USA keeping warm for winter     
         Hello

I have one list box contents changed by what happens in a second listbox.

The first listbox is setup like iTunes for storing categories, the second 
stores the information for each category and changes information when the first 
listbox is clicked,

I am trying to get the MouseDown event in the first listbox to stop and not 
move on to the next cell until changes made by the user are saved. 
The code I am using is 
Code:If Toolbar11.ToolItem5.Enabled = True then
  MsgBox "Save"
  Exit
End if

This does not stop the program it just shows the messagebox and moves on and 
runs the change event in the second list box and the changes are lost. It needs 
to stop here and let the user decide what to do.
Also tried using return but it also does not stop the program either.


I hope this makes sense.

Thanks
Phil   
                            Top                thommcgrath           Post 
subject: Re: Stopping functionPosted: Wed Jan 27, 2010 12:16 am                 
     Site Admin                
Joined: Tue May 06, 2008 1:07 pm
Posts: 367
Location: Greater Hartford Area, CT              Exit is for stopping execution 
of a loop, such as "for" or "while". To stop the function early, use "return".  
   
_________________
--
Thom McGrath
IT Developer, REAL Software  
                            Top               rbasic20091005153           Post 
subject: Re: Stopping functionPosted: Wed Jan 27, 2010 1:54 am                  
             
Joined: Sat Apr 04, 2009 5:10 pm
Posts: 641              Quote:This does not stop the program it just shows the 
messagebox and moves on and runs the change event in the second list box

I don't see the entire picture from your code.  Moves on?  How?     
_________________
Mac OS X 10.5.8/REALBasic 2008 R5.1 ~ REALBasic 2009 R4
Don't MBS-spam me.  Don't plugin-spam me.  No thanks.  
                            Top               timhare           Post subject: 
Re: Stopping functionPosted: Wed Jan 27, 2010 2:18 am                        
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 7168
Location: Portland, OR  USA              In MouseDown, you return true to stop 
the system from processing the mouse click.
Code:If Toolbar11.ToolItem5.Enabled = True then
  MsgBox "Save"
  return true
End if

   
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 4 posts ]     
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to