The @POINTER function in data, init and calc sections acts as direct memory link between the calling application and the LINGO solver. This ability to do direct memory transfers of data in and out of LINGO is very powerful. It allows for the fast transfer of data without the hassle of building and parsing disk based files.

When you call the LINGO DLL, you can pass it a list of memory pointers. @POINTER( n) refers to the n-th pointer in the passed pointer list. The @POINTER function only makes sense in a model when accessing LINGO through the DLL or OLE interfaces.

If the @POINTER function appears on the right-hand side of a data statement, as in the case of the following:

NEEDS = @POINTER( 1);

then LINGO will initialize the objects(s) on the left-hand side of the statement from the values in memory beginning at the location referenced by the pointer on the right-hand side of the statement. On the other hand, when the @POINTER function appears on the left-hand side of a data statement, LINGO will export the values of the objects(s) on the right-hand side of the data statement to the memory location referenced by the pointer on the left-hand side of the statement.

The @POINTER function reads and writes all numeric data (i.e., attribute values) using double precision floating point format. BASIC and C/C++ developers know this as the double data type, while FORTRAN developers refer to it as either REAL*8 or DOUBLE PRECISION.  Set members are passed as strings of ASCII text, with each member separated by a line feed character, with the list being terminated with an null, or ASCII 0.

When setting aside memory locations for @POINTER, you must be sure to allocate adequate space. LINGO assumes adequate space and/or supplied values are available at the passed memory locations. If you do not allocate sufficient space or values, you may experience memory protection faults or, even worse, erroneous results without warning.

So, reviewing the model's data section:

DATA:

   NEEDS = @POINTER( 1);

   @POINTER( 2) = START;

   @POINTER( 3) = ONDUTY;

   @POINTER( 4) = OBJECTIVE;

   @POINTER( 5) = @STATUS();

ENDDATA

we see the staffing requirements attribute, NEEDS, is read from the first memory location. The START, ONDUTY, and OBJECTIVE values are written to the second, third, and fourth memory locations, respectively. Finally, the value for the @STATUS function is written to the fifth memory location.   See the following section for more details on the @STATUS function.