Plays a sound file or a pre-defined Windows sound.
System.PlaySound(Sound[, WaveFile][, Wait])
Newlook Smartclient only.
Sound - (Integer, Required)
A constant specifying the type of sound to play . Specify one of the pre-defined Sound constants.
Specify nlSndWavefile if you want to play a specific .wav file.
WaveFile - (String, Optional)
Optional. String value specifying the full path name of the wave sound file to play. This parameter is ignored if the Sound argument is not set to SndWaveFile.
Wait - (Boolean, Optional)
Determines whether the script should wait until the sound has finished playing before continuing. This parameter is ignored if the Sound argument is not set to SndWaveFile.
In the following example we are playing the 'Chord' wave file when the user clicks cancel on the confirmation msgbox. VB SCRIPTvarDemoVar = app.GetValue("varUser") varConf = App.MsgBox ("Confirm username: " & varDemoVar,"User Name Confirmation",nlMsgQuestion,nlMsgYesNo)
If varConf = nlMsgYes then App.MsgBox "Username confirmed", "Confirmation",nlMsgExclamation,nlMsgOKOnly Else System.PlaySound nlSndWaveFile, "Sounds\Chord.wav", True App.MsgBox "Please log off and re-enter username", "Alert",nlMsgCritical,nlMsgOKOnly End if JSCRIPTvarDemoVar = app.GetValue("varUser"); varConf = App.MsgBox ("Confirm username: " + varDemoVar,"User Name Confirmation",nlMsgQuestion,nlMsgYesNo);
if (varConf == nlMsgYes) App.MsgBox ("Username confirmed", "Confirmation"); else System.PlaySound(nlSndWaveFile,"Sounds/Chord.wav", true); App.MsgBox ("Please log off and re-enter username", "Alert"); |
No return value.
© 2004-2021 looksoftware. All rights reserved.