× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On Fri, 21 Mar 2003, Tracy Ball wrote:
>
> Here is a sample of my program.  Regardless of the method (substrings or
> pointers), I still get an error regarding a pointer not set, or a range
> error when trying to map the old/new fields.
>

Hi Tracy,

There are two problems that I can see in this code:

1)  You do not have definitions for NewRecPtr or OldRecPtr in your
     D-specs.

2)  This code will cause the pointer error you're seeing:

     C                   Eval      OldRecPtr = %ADDR(TrgBuffer) +
     C                                         TOldOffset
     C                   Eval      Record    = OldRecord
     C                   Write     Emailaudf

Why?  because the fields in Emailaudf have no PREFIX() keyword associated
with them on the F-spec.   The fields in the NewRecord structure also
have no PREFIX associated with them -- they are therefore the same
fields.   Since NewRecord is based on a pointer, and that pointer has
not yet been set, you get the "Pointer or Parameter Error."

Even if you set NewRecPtr before the write, the code doesn't do what
you want it to.  You obviously want to write the "OldRecord" to the
file, and then write the "NewRecord" to the file.   But, as it's coded,
you're writing the "NewRecord" both times since it's fields match
your file's fields.

Most likely what you WANTED to do was assign the O_ prefix to the
"NewRecord" structure, and assign NO prefix to the Record structure.
This way, "Record" is the one you're writing out, which appears to
be what you're trying to accomplish.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.