On 17 Apr 2012, at 12:24, Norman Dunbar <[email protected]> wrote:

> On 17/04/12 10:46, Norman Dunbar wrote:
> 
>> The compilation worked, but listed calls to strfnd as having the wrong
>> number of arguments. I had three, as per online references, but it seems
>> the definition in string_h only has two :
>> 
>> strfnd(const char *, const char *)
>> 
>> So, I fixed my code to remove the third (boolean) parameter, and
>> compiled again.
> 
> Which allowed it to compile ok, but running it (see below!) shows that it can 
> no longer use the LOCATE/CONTINUE commands to find data in the sorted field - 
> always returns no records found. The normal FIND command is ok.
> 
> LOCATE uses strfnd() so I suspect it's been affected by the change to two 
> parameters from three..
> 
> 
>> Checking the map file, I see _OSERR is undefined.
>> 
>> I then changed all my own code to use errno_h and errno instead of
>> _oserr, but that gave the same result, _OSERR is undefined.
>> 
>> It may be because the DBAS library call fsd_open also sets _oserr on the
>> event of any errors, so this last one might need some jiggery pokery to
>> get around, but I'll appreciate some assistance on the remainder please.
> 
> I'm still getting the undefined _OSERR error in the map file, but I noticed 
> that an executable was still being created. I took a chance and it runs ok! 
> Hence my ability to determine that LOCATE/CONTINUE (above) were not working.
> 
> 
> Interesting!
> 
> 
> Cheers,
> Norm.
> 
> -- 
> Norman Dunbar
> Dunbar IT Consultants Ltd
> 
> Registered address:
> Thorpe House
> 61 Richardshaw Lane
> Pudsey
> West Yorkshire
> United Kingdom
> LS28 7EL
> 
> Company Number: 05132767
> _______________________________________________
> QL-Users Mailing List
> http://www.q-v-d.demon.co.uk/smsqe.htm

Norman,

The strfnd function is not a standard function in C so any you come across are 
implementation defined.  I am guessing that your code has one with different 
semantics to the library one (which if I remember correctly is based on the 
Lattice C implementation), so you need to have a #undef statement to hide the 
library implementation.   I would guess that the three argument version you 
mentioned uses the 3rd argument to define continue behaviour which is why the 
problem with LOCATE/CONTINUE.

The _oserr variable is different to errno.   The idea is that errno is used for 
standard errors and is part of the C standard while _oserr is used for ones 
that are specific to the implementation.   The standard _oserr variable is 
defined in the C startup module.   However since an extra underscore gets added 
when viewing at the linker level, I am guessing this means that your code 
refers to it without the leading underscore somewhere.   In this particular 
case you are getting away with it because it is a simple variable and not a 
label for executing code.

Dave Walker

Home:  01707 652791
Web:    www.itimpi.com
Skype:  itimpi

Sent from my iPad3
_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to