× 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.



This isn't something that is a big problem for me, but it was puzzling.  I
have a service program with a bunch of subprocedures that look things up in
files.  I wanted to use a data structure in one of the subprocedures to
concatenate a couple of file fields for easy coding of comparisons.  It
doesn't work.  The compiler flags the field names in the data structure
(which use the names of the file fields) as undefined.  I'm assuming that
it's a local variable deal, because the cross reference shows all uses of
the field names related to the fields in the data structure rather than the
file.  Besides that, if I give the fields in the data structure data types
and lengths, the program will compile, but not use the file fields.

In retrospect it makes sense, although it's making me a little confused
about local and global variables.  This seems to mean that if you use the
name of a global variable as a data structure subfield in a subprocedure,
the compiler sees it as a local variable.  OTOH, if the name doesn't appear
on a D spec, you can use it as a global.  If the data structure were defined
as a global variable, it would work--I tried it.

Here's a very schematic look a the code:

 h nomain
 Ffile1     if   e           k disk


  P subprocedure    B                   EXPORT
  D subprocedure    PI             5u 0
  D parm1                         25A   CONST

  D datastruct      ds
  D  file1fld1
  D  file1fld2
  ................


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.