Re: 4GL Newbie: How to do file I/O in 4GL. Create output to file
Posted in 1994
}From: manmetha@gauss.rutgers.edu (Rajesh Malhotra) }Subject: 4GL Newbie: How to do file I/O in 4GL. Create output to file }Date: 15 Apr 94 21:37:25 GMT }X-Informix-List-Id: <news.6335> } }Fellow Informix'ers, } } How does one do file I/O in 4GL? I need to write a 4GL program }thet would generate SQL, but not execute it. This generated SQL needs to }be written to a file, and executed at a different location and time. } } How would I open a file, write to it and then close the file? }I am running 4GL ver 4.00 on an IBM RS6000 AIX 3.2.4. } } Any other ways that I could capture the output? I cannot use }redirect since I have a screen up that prompts the user for input. Write a report that takes the strings as the argument and simply writes to the file you choose to name in the START REPORT xyz TO filename. Note that filename can be a CHAR variable. Set that PAGE LENGTH to 1, the TOP and BOTTOM MARGIN to 0, and probably the LEFT MARGIN too. You might want to set the RIGHT MARGIN to 80 or 75, and then use WORDWRAP. Or write a general purpose I/O package in C, or grab one from someone else, but for the purposes you ask about, I'd use a report. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>