insightgetattachbytag
insightgetattachbytag |
Purpose
Searches the scenario and the containing app for an attachment or attachments with the given tag, and retrieves them from the Insight server, placing them in the Mosel working directory where they can be read by the model. If any scenario attachments with the given tag are found, these are retrieved without searching the app. If no scenario attachments with the given tag are found, then the search continues at the app level.
Synopsis
procedure insightgetattachbytag(tag:text, attachments:list of insightattachment)
procedure insightgetattachbytag(tag:text, attachment:insightattachment)
procedure insightgetattachbytag(tag:text, filenames:list of text)
Arguments
tag
|
The tag to search for
|
attachment
|
An attachment object which will be populated with the details of the attachment that was retrieved
|
attachments
|
A list which will be populated with the details of the attachments that were retrieved
|
filenames
|
A list which will be populated with the filenames of the attachments that were retrieved
|
Example
declarations attachment: insightattachment end-declarations insightgetattachbytag('mytag1', attachment) if insightattachstatus<>INSIGHT_ATTACH_OK then writeln("Error searching for attachments") else initializations from attachment.filename MY_ARRAY end-initializations end-if
Example of searching for and retrieving an attachment with the tag
tag1
Further information
1. Check the attachment status code using
insightattachstatus to determine whether the attachment(s) were successfully retrieved.
2. Attempting to access attachments when the model is not being run through Xpress Insight will cause the model to abort with an error.
Related topics