Code Snippets
A code snippet is a fragment of code or text that can be stored in an XML file and reused at a later time. Code Snippets were introduced in Visual Studio .NET 2005 and have an open format.
Creating Code Snippets
Creating Code Snippets goes beyond the scope of this document, a good starting point is the online MSDN: Creating and Using IntelliSense Code Snippets or Create a Basic Code Snippet. The Code Snippets provided by the installation might as well serve as an example. When creating Code Snippets for use with AIMMS, it is necessary to set the Language XML-attribute of the Code XML-element to the value Aimms. Next, the XML files need to stored in the Snippets subdirectory of the AIMMS installation (e.g. C:UsersxxxAppDataLocalAIMMSIFAAimms4.xx.x.xxx-x64Snippets).
Using Code Snippets
The Code Snippet selection menu can be brought up by pressing the Number 1 key while holding the Control key (Ctrl + 1 ). The desired Code Snippet can be inserted by navigating the list using the mouse or arrow keys and selecting the appropriate Code Snippet by pressing left mouse button or the enter key. Alternatively a Code Snippet can be inserted by typing the shortcut of the Code Snippet and pressing the Tab key. Valid shortcuts are e.g. for or while or if.
Example:
Before insert the code snippet
After inserting the code snippet