Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning a string from a method
Message
From
15/11/2004 16:06:04
 
 
To
15/11/2004 15:29:34
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00961508
Message ID:
00961528
Views:
6
>I have a class which contains a method called RecordHook(). When that class is instantiated, it may or not contains some code in the RecordHook() method. However, in the main class, I have this code:
>
>
>This.cHtml=This.cHtml+This.RecordHook()
>
>
>This code gets executed even if there is no code in RecordHook(). I would prefer to have the RecordHook() method, when it contains some code to have this as the last line of its code:
>
>
>RETURN lcHtml
>
>
>However, if there is no code, this will fail.
>
>I understand that I should do something like this if I want this to work all the time from the main code:
>
>
>This.RecordHook()
>* The HTML code is now appended to This.cHtml
>
>
>and from the RecordHook() method in its last line:
>
>
>This.cHtml=This.cHtml+lcHtml
>
>
>But, as I would prefer to have the RecordHook() method to return the HTML, would it there be a way to determine if some code is present in RecordHook() so I could have something like this:
>
>
>IF This.RecordHook.CodeIsPresent
>   This.cHtml=This.cHtml+This.RecordHook()
>ENDIF
>
VFP9 Help for GETPEM() shows a technique that might be useful. I don't know off the top of my head if it'll work in runtime or not.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform