Forum Discussion
FICO
5 years agoCommunity Manager
Issue with scenario attachments; attachment not found
Hello - looking for advice/help related to an issue with scenario attachments. we are using python to create several excel workbook files, which contain model input data. we have a set of strings (i...
FICO
5 years agoCommunity Manager
Simply replace the file size check, with the existence check:
(!@doc.
@descr Check if a regular file or folder exists.
@param filename The file name to test.
@return True if the regular file or folder exists.
!)
public function fexists(filename: text): boolean
declarations
status = getfstat(filename)
end-declarations
returned := status <> 0 and bittest(status, SYS_TYP) <> SYS_OTH
end-function
procedure set_attachment(filename: string, tags: list of string)
if fexists(filename) then
insightputscenattach(filename)
if insightattachstatus=INSIGHT_ATTACH_OK then
insightsetscenattachtags(filename,tags)
writeln("Attachment "+filename+" added to the scenario.")
else
writeln("Error adding attachment "+filename)
exit(1)
end-if
else
writeln("Error adding attachment "+filename)
writeln(" Filesize = 0 for "+filename)
end-if
end-procedureRelated Content
Related Content
- 11Views0likes2Comments
