Home AMX User Forum NetLinx Studio
Options

Netlin 2.2

I am very like the NetLinx. But I found some problem.If I define varible or struct in include file. I can not see this varible in all workspace.
What I have to do for see this varible in all my workspace?

Comments

  • Options
    DHawthorneDHawthorne Posts: 4,584
    If you put the DEFINE_TYPE keyword at the top of your include, your #INCLUDE line should be right at the top of your code, before the DEFINE_DEVICES section. The same goes for whatever other types of variables you are trying to include. YOu must do it this way if your include has multiple sections (ie., DEFINE_CONSTANT and DEFINE_VARIABLE together, etc.). If it only contains one type of item, do not place the DEFINE_* keyword(s) in there at all, and put your #INCLUDE line in the appropriate section.
  • Options
    frthomasfrthomas Posts: 176
    I am not certain it is THAT strict, but it certainly wants an element defined before you use it. In my experience you can pretty much include a file anywhere, but it should contain the appropriate DEFINE_XXX for what you're defining, and nothing of the file is usable (in the main program) before the file is #included.

    The only thing NetLinx finds no matter where defined are functions (that is, function A can call function B defined below function A). It also seems pretty relaxed about which section functions are defined in.
    But variables, constants, devices, STRUCT, etc must be defined before they are used (from top to bottom) and in the appropriate section (that can appear twice or more times).

    Hope this helps

    Fred
Sign In or Register to comment.