Home AMX User Forum NetLinx Studio

Missing drop-down variables for structure

jjamesjjames Posts: 2,908
Okay, so I'm programming away, and notice I can't get a variable in a structure to pull up in the drop-down selection when typing. Here's my code:

DEFINE_TYPE
STRUCTURE _sLOADS
{
CHAR cLoadNumber[1]
CHAR cLoadPercentage[3]
}

DEFINE_VARIABLE
(*** STRUCTURE VARIABLES ***)
_sLOADS LoadStruct[51]
_sLEDS LEDstruct[114]

(*** INTEGER VARIABLES ***)
INTEGER nFIND
INTEGER nLENGTH

(*** CHAR VARIABLES ***)
CHAR cVANTAGEBUFFER[15]
CHAR cLEDBUFFER[25]
CHAR cLOADBUFFER[25]
CHAR cKeypadAddress[3]
CHAR cLoadAddress[2]

So when I type in "LoadStruct." it only pulls ups cLoadNumber, and not cLoadPercentage. Now when I just start to type cLoadPercentage anywhere alone, it'll pop-up. Am I defining it wrong or is it a glitch/bug in the the software?

Comments

  • GSLogicGSLogic Posts: 562
    It is a bug in the software. I find most of the time it will work, you can try closing Studio and reopening.

    I'm sure you know but, this doesn't mean the variable it not in the structure, it just doesn't show up in the drop down.
  • jjamesjjames Posts: 2,908
    Okay. I've ran into this issue one other time, and went with it anyways, and everything worked. Glad to know it's software and not me. Thanks for the info and fix.
  • Joe HebertJoe Hebert Posts: 2,159
    Auto suggest and auto complete were welcome additions in the previous version of Netlinx Studio and much improved in the latest 2.3 version of Netlinx Studio. However, auto suggest for structures is buggy and the algorithm needs some work. For example, if using the following:
    DEFINE_TYPE
    
    STRUCT	sLight {
    
       CHAR	   Name[32]
       CHAR	   Address[16]
       INTEGER Intensity
       
    }
    
    DEFINE_VARIABLE
    
    sLight	sLight[b]s[/b][100]
    
    And then elsewhere in code (under DEFINE_START or in a call or wherever) the following is typed in:

    sLights[1].

    nothing is suggested.

    However, if the following is typed in:

    sLight[1]. (which is obviously illegal and of no use)

    then Name, Address, and Intensity are suggested in a dropdown box.

    I hope the good folks in AMX engineering will revisit auto suggest and continue to improve their IDE like they did by fixing auto complete and by adding the call tips for user defined functions/calls. Showing call tips for built in AMX functions would be great to see to.

    Joe
Sign In or Register to comment.