Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ACCESS method
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00534387
Message ID:
00534509
Views:
13
Got egg on my face :( Realized later on what my problem was. It's amazing how many times you can read the manual and skip over that one vital piece of information.

red
>Hi!
>
>You require to RETURN the value from Access method:
>
>
>hidden procedure DebugDir_Access
>  if empty(this.DebugDir)
>    wait window 'DebugDir property has not been set'
>  endif
>  return this.DebugDir
>endproc
>
>
>HTH.
>
>>The following is a class defintion:
>>*
>>define class MFCGlobal as Custom
>> DebugDir = ""
>> *
>> hidden procedure DebugDir_Assign
>> * Debug directories are always under C:\TEMP
>> lparameters xNewVal
>> *
>> if type('xNewVal') <> 'C'
>> wait window 'MFCGlobal:Invalid assignment, must be a character value'
>> else
>> xNewVal = alltrim(xNewVal)
>> if right(xNewVal, 1) <> '\'
>> xNewVal = xNewVal + '\'
>> endif
>> this.DebugDir = 'C:\TEMP\' + xNewVal
>> if !Directory(this.DebugDir)
>> md this.DebugDir
>> endif
>> endif
>> endproc
>>enddefine
>>
>>If I create an object based on this class and assign a value to the DebugDir property and then print it, it works great. Now the problem is when I add the following access method:
>>
>>hidden procedure DebugDir_Access
>> if empty(this.DebugDir)
>> wait window 'DebugDir property has not been set'
>> endif
>>endproc
>>
>>If I print the DebugDir property it prints out a logical value. When I go into debug mode, the propery within the object is set correctly, it just getting to that value outside of the object always returns a logical. Take the access method out and things go back to working again.
>>
>>ANY help would be greatly appreciated.
>>
>>Rodney E. Dixon
>>McKee Foods Corporation
red

Rodney E. Dixon
Mckee Foods Corporation
Collegedale, TN
Previous
Reply
Map
View

Click here to load this message in the networking platform