Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 To: khubaib khalid
  Where is khubaib khalid?
 HaroonAbad
 Pakistan
 khubaib khalid
 Tags
Subject: RE: what is work of wait windows in these .
Thread ID: 395632 Message ID: 395668 # Views: 55 # Ratings: 2
Version: Visual FoxPro 9 SP2 Category: Active X Controls & OLE Automation
Date: Thursday, January 16, 2014 11:42:49 PM         
   


> what is work of wait windows in these codes..
>
> I download codes from :http://www.west-wind.com/wconnect/weblog/ShowEntry.blog?id=823
>
> to run mp3 file...
>
> when i exculde *WAIT WINDOW "Press any key to stop" this line, mp3 does not run ,but when i inculded its run...
>
> LOCAL loPlayer as WMPlayer.OCX
> loPlayer = CREATEOBJECT("WMPlayer.OCX")
> loItems = loPlayer.MediaCollection
> loSong= loItems.add("d:\sound\aa.mp3")
>  
> LOCAL loPlayList as WMPlayer.IWMPPlaylist
> loPlayList = loPlayer.currentPLayList
> loPlayList.AppendItem(loSong)
>  
> loPlayer.Controls.PLay()
>  
> *WAIT WINDOW "Press any key to stop"
> loPlayer.Controls.Stop()
>  
> *** Clear the playlist for the next song
> loPlayList.clear()
> 



WAIT = pauses the execution of the next line

WAIT WINDOW = pauses execution of the next line while showing the message "Press any key to stop in this case" in a system message window located in the upper-right corner of the main Visual FoxPro window.

WAIT WINDOW NOWAIT = Shows the message but continues executing outright the line that follows it (next lines of codes)

So in your sample above, VFP executes everything up to loPlayer.Controls.PLay(), then waits for a key press. When you press a key, it continues to the next line which is loPlayer.Controls.Stop() and loPlaylist.clear() which stops the playing of the song.

That is why when you put a remarks on WAIT WINDOW, it looks like it never does a thing because it plays, and stop outright.




https://vfpx.codeplex.com/releases/view/99045
http://sandstorm36.blogspot.com

ENTIRE THREAD

what is work of wait windows in these . Posted by khubaib khalid @ 1/16/2014 3:27:16 PM
RE: what is work of wait windows in these . Posted by Stefan Wuebbe @ 1/16/2014 3:41:46 PM
RE: what is work of wait windows in these . Posted by David Mustakim @ 1/16/2014 4:03:28 PM
RE: what is work of wait windows in these . Posted by Jun Tangunan @ 1/16/2014 11:42:49 PM