4gl to C problem
Posted in 2003
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues, Versions, Editions & End-of-Life
Having not used 4gl to C for a while something is doing my head in, IDS 9.30, 4gl 7.30.UC3 on Solaris 7 Why doesn't this not work, it cores on the popint, changing it to popquote(teststr,11) it's fine, reversing the popint/popquote makes no difference - it still cores on popint. As I don't do difficult it must be easy and obvious but I can't see it 4gl main define mystat integer CALL listfile("/home/eric",10) returning mystat; end main C file #include <stdio.h> #include <sys/types.h> #include <fglapi.h> int listfile(int nargs) { int ftype; char teststr[11]; popint(ftype); popquote(teststr,11); retint(2); return(1); } -- Paul Watson # Oninit Ltd # Growing old is mandatory Tel: +44 1436 672201 # Growing up is optional Fax: +44 1436 678693 # Mob: +44 7818 003457 # www.oninit.com #
In message <3F659730.4CB59084@oninit.com>, Paul Watson <paul@oninit.com> writes >Having not used 4gl to C for a while something is doing my head in, >IDS 9.30, 4gl 7.30.UC3 on Solaris 7 > >Why doesn't this not work, it cores on the popint, changing it to >popquote(teststr,11) it's fine, reversing the popint/popquote >makes no difference - it still cores on popint. > >As I don't do difficult it must be easy and obvious but I can't see >it > >4gl > >main > > define mystat integer > > CALL listfile("/home/eric",10) returning mystat; > >end main > >C file > >#include <stdio.h> >#include <sys/types.h> >#include <fglapi.h> > >int listfile(int nargs) >{ > int ftype; > char teststr[11]; > > popint(ftype); popint(&ftype); > popquote(teststr,11); > > retint(2); > return(1); > >} > -- Andrew Lennard andy@kontron.demon.co.uk
Andy thanks for that, knew it was obvious and it is the TFM Paul Andy Lennard wrote: > > In message <3F659730.4CB59084@oninit.com>, Paul Watson <paul@oninit.com> > writes > >Having not used 4gl to C for a while something is doing my head in, > >IDS 9.30, 4gl 7.30.UC3 on Solaris 7 > > > >Why doesn't this not work, it cores on the popint, changing it to > >popquote(teststr,11) it's fine, reversing the popint/popquote > >makes no difference - it still cores on popint. > > > >As I don't do difficult it must be easy and obvious but I can't see > >it > > > >4gl > > > >main > > > > define mystat integer > > > > CALL listfile("/home/eric",10) returning mystat; > > > >end main > > > >C file > > > >#include <stdio.h> > >#include <sys/types.h> > >#include <fglapi.h> > > > >int listfile(int nargs) > >{ > > int ftype; > > char teststr[11]; > > > > popint(ftype); > > popint(&ftype); > > > popquote(teststr,11); > > > > retint(2); > > return(1); > > > >} > > > > -- > Andrew Lennard andy@kontron.demon.co.uk -- Paul Watson # Oninit Ltd # Growing old is mandatory Tel: +44 1436 672201 # Growing up is optional Fax: +44 1436 678693 # Mob: +44 7818 003457 # www.oninit.com #