Re: Informix 4GL and C retquote function
Posted in 1991
Path: emory!swrinde!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!hplabs!pyramid!infmx!markj From: markj@informix.com (Mark Jeske(Chicago Consultan)t) Newsgroups: comp.databases Message-ID: <1991Jul1.182458.17126@informix.com> Date: 1 Jul 91 18:24:58 GMT References: <1991Jun30.164111.21858@dircon.co.uk> Sender: news@informix.com (Usenet News) Organization: Informix Software, Inc. In article <1991Jun30.164111.21858@dircon.co.uk> uaa1006@dircon.co.uk (Peter Miles) writes: > > >I'm having difficulties with the retquote function, when I use >it to return strings from a C program to an Informix 4GL program. > >It works fine when I use it to return a string, but does not >work when I try to return a NULL string. > >How should I return a NULL string to the 4GL? Using the following: > retquote(NULL); > retquote(""); > retquote((char *)'\\0'); > retquote('\\0'); >all cause an 'L' character to returned to the 4GL. > >My 4GL uses a: LET retstr=func(abc) in the .4gl file and >the C function 'func'should return either a string or a NULL. > >Any ideas? > This works for me: main define s char(10) let s = func() if( s is null ) then display "s is null" else display "s ", s end if end main int func( n ) int n ; { char s[10] ; let s[0] = '\\0' ; retquote( s ) ; return( 1 ) ; } What version of 4gl are you running, and on what machine? Don't forget you need the return(1) in the c function. mark jeske markj@infmx.com 708-699-5850