I think it should also include the path name for example call faglSaveAsFile(m_A,'c: est.agl',status)Please try that and see if you get an error. It works for me.
Thanks. While verifying that av_filename was in fact a full pathname, I noticed that av_filename (declared as CHARACTER*(512)) had a large number of trailing blanks. On trimming these, the code works fine:
call faglSaveAsFile (M, trim(av_filename), status)
Too bad the error message wasn't more useful.
Since av_filename is probably a C-style string, the only reliable way is to use trim(av_filename)//char(0).
I've seen you mention C-style strings in other topic threads. How is a person to know when he's dealing with a C-style string terminated with a null when calling a function or subroutine or not?
Well, all standard Fortran routines (DFLIB, DFPORT, intrinsics) use standard Fortran strings (fixed-length, no termination) except where stated otherwise in the docs (e.g. APPENDMENUQQ). On the other hand, all DFWIN (Windows API) routines use C-style strings (CHAR(0)-terminated).
As for other routines, such as Array Viewer ones, there's no 100% way to know except to consult the documentation. Another way is to inspect contents of appropriate .lib and take a look at the exported symbol - STDCALL routines have @n appended at the end, where n is number of arguments*4; if that number is greater than number of arguments in documentation, it's probably a Fortran-style string (hidden character length passed as additional argument).
I've just inspected AVIEW160.lib and saw that faglSaveAsFile is @16, indicating that string length is passed. Thus, my advice was wrong; it seems that it's just a bug in faglSaveAsFile -- they forgot to TRIM the filename argument.