I built this program about 15 to 20 years ago and I completely forgot what this keyword "PROTECTED" provides. If you need to see it in context here is a snippet of the code... VFP sees it as part of its language code by Highlighting it and uppercasing it as you type it in. I guess I got old and although I used it in the past I have no memory of its nature of protection. Furthermore, VFP HELP does not provide any clues about its use or meaning! I scoured the VFP Help assistant.
I am trying to add features to this massive application, so, any help would be very appreciated.
Dennis Kean
Simplicity is the extreme degree of sophistication.
Leonardo da Vinci
Code:
[COLOR=#AD7FA8]DEFINE CLASS[/color][/b] TMidiNote As Session
[b][COLOR=#AD7FA8]#DEFINE[/color][/b] MIDI_STATUS_PLAYNOTE 9
[b][COLOR=#AD7FA8]#DEFINE[/color][/b] MIDI_STATUS_PATCH 12
[b][COLOR=#AD7FA8]PROTECTED[/color][/b] hDevice, channel
hDevice=0
channel=0
[b][COLOR=#AD7FA8]PROCEDURE[/color][/b] Init(lDeclare)
THIS.declare
IF NOT THIS.OpenDevice()
RETURN .F.
ENDIF
[b][COLOR=#AD7FA8]PROCEDURE[/color][/b] Destroy
THIS.CloseDevice
[b][COLOR=#AD7FA8]PROCEDURE[/color][/b] midiReset
= midiOutReset(THIS.hDevice)
[b][COLOR=#AD7FA8]PROTECTED FUNCTION[/color][/b] OpenDevice() As Boolean
IF midiOutGetNumDevs() = 0
MESSAGEBOX("No Midi Devices found.",48, "MIDI Error")
RETURN .F.
ENDIF
LOCAL hDevice, nResult
hDevice=0
nResult = midiOutOpen(@hDevice, 0,0,0,0)
THIS.hDevice = m.hDevice
IF nResult <> 0
MESSAGEBOX("Call to midiOutOpen failed: " + TRANSFORM(nResult), 48, "MIDI Error")
ENDIF
RETURN (m.nResult=0)
[b][COLOR=#AD7FA8]PROTECTED PROCEDURE[/color][/b] CloseDevice
IF THIS.hDevice <> 0
= midiOutReset(THIS.hDevice)
= midiOutClose(THIS.hDevice)
THIS.hDevice = 0
ENDIF]
I am trying to add features to this massive application, so, any help would be very appreciated.
Dennis Kean
Simplicity is the extreme degree of sophistication.
Leonardo da Vinci