Re: C vs. 4GL (was Re: Informix Evaluation)
Posted in 1995
In article <3iarc7$aqr@cssun.mathcs.emory.edu>, alan@po.den.mmc.com (Alan Popiel) says: > <mega snip> >Certainly. Heck, with 4GL you can't even read from a text file, unless you >trick it by loading into a table with a long CHAR(nn) column. But 4GL lets >you incorporate C functions very easily (compiled) or sort-of easily (RDS), >for those cases where you need some extra functionality that 4GL does less >well or not at all. > It is possible to read from text files by writing a few 'C' functions to build into either your RDS runner, or your bespoke libraries, viz: f_open( <filename> ) where filename is the absolute or relative name of the UNIX file in question, f_get( ) RETURNING text f_close() You could probably (if you new more about C than I do) be able to specify the file number to be used for each 'f_open()' and then include it in the 'f_get()' and 'f_close()' calls. 'f_put()' should also be possible with very little more effort. We have something similar to this in our product which allows a 4GL program to view a UNIX file. Obviously, it could use it as input rather than just display the contents. Not an elegent solution but a bit better than loading the text into the database, I think! Cheers Sally