Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Comunicados
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

saving data files

diana_g_1
Principiante
800 Visualizações

Hi, I'm writing a graphic program in fortran and I want a menu option that save me the informations of the figure that the user draw. Then I think to open a txt file and write into it informations. The program save by default the txt file in the same directory of the program, instead I want that the user can choose the directory where to save it. Is this possible? How can I do it?

0 Kudos
4 Respostas
Anthony_Richards
Novo colaborador I
800 Visualizações

Is this a QuickWin program (you mention 'menu' item...).
When building a name for your textfile, you can always add a full path to the folder to which you want to save it.
If the folder doesn't exist, you can create one using MAKEDIRQQ. You can changedirectory using CHANGEDIRQQ.

Look up the Windows API function GETSAVEFILENAME for opening a SaveAs common dialog box which allows you to navigate to the folder of choice and create one if required, returning a full-path filename for the file you want to save data to..

andrew_4619
Colaborador honorário III
800 Visualizações

There is a Intel fortran sample showing how to use Windows API function GETSAVEFILENAME 

SergeyKostrov
Contribuidor valorado II
800 Visualizações
>>...The program save by default the txt file in the same directory of the program, instead I want that the user can choose >>the directory where to save it. Is this possible?.. Yes and you need to initialize lpstrInitialDir member of OPENFILENAME structure passed to GetSaveFileName function.
diana_g_1
Principiante
800 Visualizações

thank you very much to everyone!

Responder