KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: 2D Array Elements as Parameters
PRODUCT: 4D | VERSION: 11 | PLATFORM: Mac & Win
Published On: September 24, 2008

In 4D 2004 you could pass an individual element from a 2D array as a parameter to a command that expects a variable (but the parameter was ignored and no error was returned). This is no longer possible in 4D v11 SQL. A syntax error will be returned if a command is expecting a variable and if the provided parameter is an element of the 2D array, such as MyArray{1}{4}. In order to use the 2D array element, assign it to a variable and then pass the variable to the command. For example, instead of:

Alert(MyArray{1}{4})



Do:

C_TEXT($temp)
$temp:=MyArray{1}{4}
Alert($temp)