Re: 4GL Function Tools needed
Posted in 1995
In article <40qets$32pc@news-s02.ny.us.ibm.net>, <labutis@ibm.net> writes: > Path: psinntp!pubxfer.news.psi.net!psinntp!psinntp!gatech!news.sprintlink.net!newsfeed.internetmci.com!solaris.cc.vt.edu!swiss.ans.net!newsjunkie.ans.net!news-m01.ny.us.ibm.net!usenet > From: labutis@ibm.net (Richard Labutis) > Newsgroups: comp.databases.informix > Subject: 4GL Function Tools needed > Date: 15 Aug 1995 15:36:28 GMT > Lines: 12 > Message-ID: <40qets$32pc@news-s02.ny.us.ibm.net> > Reply-To: labutis@ibm.net (Richard Labutis) > NNTP-Posting-Host: slip38-92.il.us.ibm.net > X-Newsreader: IBM NewsReader/2 v1.09 > > I am presently doing alot of Informix 4GL > programming. There are many situations > where I need to search for text in a string, > replace text in a string, etc. Presently I > am writing functions to accomplish this sort > of thing as the need arises. I was wondering > if there is an existing 4GL function library > that I could download. I know these libraries > exist for many programming languages. Any > help on this would be appreciated. > > > I highly recommend writing functions to manipulate strings in C and accessing them through 4GL. I do the same thing to access the open(), read(), and close() system calls since if I need to read a file (like a fixed-field, no-delimiter mailing list file off tape) 4GL can't do it (!). An example (note that popvchar() and retint() are the functions used to access the 4GL stack): int c_open_read(nargs) int nargs; { char fileName[FILENAME_MAX]; int fd; if (nargs != 1) retint(-1); else { popvchar(fileName, FILENAME_MAX); retint(open(fileName, O_RDONLY)); } return(1); } In your 4GL code, you would CALL c_open_read("foo.txt"). We have a substring matching function somewhere, but I can't find it now...