The SAVE command saves the current model to a file. The syntax is:

SAVE filename

where filename is the name of the file to save your model in. LINGO saves the model in text format. You can read the model back into LINGO with the TAKE command. We recommend you use an extension of .LNG on your model files, so you can readily identify them.

You may want to use your own text editor to modify your model. If you do, be sure to save the LINGO model in text (ASCII) format. Use the TAKE command to reopen the model in LINGO when you are through editing it.

In the following example, we input a small model and save it in the file titled MYMODEL.LNG:

: !Enter a small model

: MODEL

? MAX = 20*X + 30*Y;

? X <= 50;

? Y <= 60;

? X + 2*Y <= 120;

? END

: !Save model to a file

: SAVE MYMODEL.LNG

:

If you open the model file, MYMODEL.LNG, in a text editor, you should see the following:

MODEL:

  1]MAX = 20*X + 30*Y;

  2]X <= 50;

  3]Y <= 60;

  4]X + 2*Y <= 120;

END