Skip to content

Best Practices when modifying supplied .sml

Forums Forums SIMPOL Programming Best Practices when modifying supplied .sml

Viewing 16 post (of 16 total)
  • Author
    Posts
  • #1966
    Michael
    Keymaster

    On 25/06/2012 19:30, John D Kromkowski wrote:
    > On 6/25/2012 6:24 AM, Neil Robinson wrote:
    >> On 23/06/2012 01:51, John D Kromkowski wrote:
    >>> include "tbcombos.sma" include "toolbar.sma" include "errors.sma"
    >>>
    >>> When I switched the order of the includes to put errors.sma first, problem went a way. Is this a bug or just something I
    >>> should have know about?
    >> Not a bug, but something you need to be aware of. The compiler is a single pass complier, so it processes the include files
    >> in the order it hits them. That is why constants used throughout the project need to be at the front of the include list.
    >>
    >> Ciao, Neil
    > Ok. Is this in the documentation that I missed? On related note:

    I am not sure about this one, to be fair.

    > Could (Should) the
    >
    > include "uisyshelphdr.sma"
    >
    > statement which is part of tcombos.sma, just be put in the primary.sma?

    Yes, if you are using the items that are defined in uisyshelphdr.sma in other places in the code (which will be the case for a
    more complex application), then just move it to the top of the main program file.

    > And if you link to the uisyshelp.sml (under "settings"), why do you even need to include uisyshelpdr.sma

    The uisyshelphdr.sma includes constant definitions so that you can use the constant names in your code rather than hard-coding
    values. This protects your code from future updates (if the value of the constant changed it wouldn't matter if you are using the
    name instead of the value). It also makes your code easier to read. That is the whole point of most of the include files, they
    contain constant definitions, not code.

    Ciao, Neil

Viewing 16 post (of 16 total)
  • You must be logged in to reply to this topic.