Trying to use string routines with Informix 4gl
Posted in 1991
Path: emory!wuarchive!uunet!mcsun!ukc!slxsys!dircon!uaa1006 From: uaa1006@dircon.co.uk (Peter Miles) Newsgroups: comp.databases Message-ID: <1991Jun21.002034.2984@dircon.co.uk> Date: 21 Jun 91 00:20:34 GMT Organization: The Direct Connection, UK I'm trying to use the UNIX string routines as callable C routines in Informix 4gl. Specifically, I want to use strtok() to process a line of text. I've set up a file containing two function definitions. These are: int first_word(argc) int argc; { char cmdline[80]; popquote(cmdline, 80); retquote(strtok(cmdline, " \\t")); return(1); } int next_word(argc) int argc; { retquote(strtok(NULL, " \\t")); return(1); } I compile this with my 4gl program using 'c4gl'. Basically, in my 4gl program, I want to call first_word() with a string variable (which consists of words separated by spaces or tabs). The first word of the string is returned. Then, later on I call next_word() several times to get each of the other words in the string varible, one by one. However, this doesn't work. The first word is returned OK when I call first_word(). But the next_word() function doesn't appear to return anything to the 4gl program. Can anyone suggest why this might be, and how I can get around the problem? Please reply by EMAIL and I'll summarize to the Net if there's interest. -- Pete -- Pete Miles uaa1006@dircon.co.uk ...ukc!dircon!uaa1006