In a class definitions contained in a VCX, you can add a Description to each
custom property and method that you define.

 

However, I am creating a class definitions in a PRG file, and I want to know
if there is a standard way of using comments or some other kind of markup in
the class definition to include descriptions for the properties and methods?

 

I don't think there is an official VFP coding rule for this, so I guess I'm
asking if there is a widely adopted standard among VFP coders who use
PRG-based classes. I know that C# has a standard way of adding descriptions
to its properties and methods, and I'm wishing (hoping) VFP has a standard
as well.

 

Why does this matter?  Well, for one, I would hope to be able to create
documentation for the class definition (from a documentation tool) where I
could extract this description info right from the PRG. I'm not looking to
create my own format, if there is a (widely used) standard already in place.
In order for the documentation tool to work properly, it would expect the
correct format, syntax, location, etc be used consistently.

 

Any standard format out there?

 

 

Define Class Example as Custom

 

    nProperty1 = 1 && Description of property goes here??

 

    * Description of property goes here??

    cProperty2 = 'SomeProp'

 

    * Description of property goes here??

    * Could span across multiple lines??

    cProperty3 = 'SomeProp'

 

    * Description of method goes here??

    * Could span across multiple lines??

    Procedure MethodOne(tnParameter1, tcParameter2) 

     *-- Code goes here

    EndProc

 

 

EndDefine

 

 

As an example, here is how it's handled in C#:

 

This show a method definition, with the description located above it using
/// and some xml tags. Notice that you can also describe parameters.

 

        /// <summary>

        /// Updates the loaded entity with the contents from a quote object

        /// </summary>

        /// <param name="quote"></param>

        public void UpdateEntityFromStockQuote(StockQuote quote)

        {

            if (this.Entity == null)

                return;

 

            if ( !string.IsNullOrEmpty(quote.Company) )

                this.Entity.Company = quote.Company;

 

            // if the price isn't set service is down or not providing data
at the moment

            if ( quote.LastPrice == 0.00M )

                return;

 

            this.Entity.LastPrice = quote.LastPrice;

            this.Entity.LastDate = quote.LastQuoteTime;

            this.Entity.OpenPrice = quote.OpenPrice;

            this.Entity.Change = quote.NetChange;

            this.Entity.LastDate = quote.LastQuoteTime;

 

            this.Entity.ItemValue = this.Entity.LastPrice * this.Entity.Qty;

        }

 



--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/010001cc5b65$0320fda0$0962f8e0$@com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to