none
how to define an array?

    Question

  • I have this situation. There are two functions in a prg file. The first function is major, the second one is simply a container for a large DO CASE ENDCASE clause with about 18 macros for different choices. Those macros do the following (individually): SELECT FROM <table name> WHERE ... INTO ARRAY arr1

    The main function gets a cAlias as an output parameter and this parameter is used to address the second function. The return value for the second funct is an above macro.

    This macro is then used to compactify code and do the SELECT at runtime.

    The trouble is that the variable array arr1 appears from nowhere in the main function. It is there at runtime only but not during the compile and when I do build I get an error because the build compiler does not see it. The interactive compiler ignores the problem completely and I noticed this thing only after the first build with this function.

    This array needs a definition like LOCAL arr1 AS .... but there is no array type in intellisense. I tried other types like String or Variant but they would give me errors.

    In principle it is not something I will worry about in a long run since even in StartMode = 4 I have no problem using this function at all. It is only during the build that I get an error message. The error message is that this variable is not defined (or not found) and I have to click a button "ignore" to close the error message.

    Thanks.

    Wednesday, March 15, 2006 11:30 PM

Answers

All replies

  • I have no idea what you are asking…

    But to declare an array use the declare statement:

    Declare myarray[25]

    dave

    Thursday, March 16, 2006 12:15 AM
  • I cannot declare an array since my array that comes out of the macro has variable number of columns.
    Thursday, March 16, 2006 2:44 AM
  • Hi,

    i think EXTERNAL ARRAY arr1 will solve yout problem...

    Thursday, March 16, 2006 7:23 AM
  • I think it should. Thank you. It is a simple a bright idea.
    Thursday, March 16, 2006 4:42 PM