Templates, Tools and Utilities for Clarion Developers
|
|
|
|
Add a comment to an Icetips Article
Please add your comments to this article.
Please note that you must provide both a name and a valid email address in order
for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!
Back to article list
Search Articles
Add Comment
Printer friendly
Direct link
Templates: Checking if an embed point has code
1998-04-23 -- Mike Hanson
Newsgroups: topspeed.products.c4
>Embeds get generated conditional to them containing code, so the generator
>can obviously tell
>
>Isn't that what #SUSPEND, #RELEASE, etc are for?
>
>Why do you want to know?
Well, the embeds that I'm generating would prove the existense of code
in a local classes method. If it's there, then I need to generate the
corresponding prototype in the local class defintion.
I ended up using the %BytesOutput internal token. Something like
this:
#ATSTART
#DECLARE(%HasMethod)
#ENDAT
#!
#AT(%LocalProcedures)
#SET(%HasMethod, %False)
#SET(%ByteCount, %BytesOutput)
#SUSPEND
#?MyClass.MyMethod PROCEDURE
#?CODE
#EMBED(%MyEmbed,'My Embed')
#RESUME
#SET(%ByteCount, %BytesOutput-%ByteCount)
#IF(%ByteCount)
#SET(%HasMethod, %True)
#ENDIF
#ENDAT
#!
#AT(%LocalDataClasses)
MyClass CLASS(BaseClass)
#IF(%HasMethod)
MyMethod PROCEDURE
#ENDIF
END!CLASS
#ENDAT
Catch you later!
-=> Mike Hanson, BoxSoft <=-
www.BoxsoftDevelopment.com
Mike@BoxsoftDevelopment.com
boxsoft@compuserve.com
Today is December 3, 2024, 11:59 am This article has been viewed 35216 times.
Google search
has resulted in 6 hits on this article since January 25, 2004.
Back to article list
Search Articles
Add Comment
Printer friendly
|
|
|