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



Scott,

> > I looked at your IFS tutorial too - it helped a lot.  but a couple of
the
> > techniques you've been telling me to use here, are done a little
> > differently there.  Is that stuff older and you've found better ways of
> > doing it?

> Maybe?  What do you mean, specifically?

specifically,

prototype of reading a text file in your tutorial:

  P readline        B                   export
  D readline        PI            10I 0
  D   fd                          10I 0 value
  D   text                          *   value
  D   maxlen                      10I 0 value

in your suggestion from friday night:

  D ReadStrmF       PR             1N
  D   peFD                        10I 0 value
  D   peRecord                 32765A   varying options(*varsize)
  D   peMaxLen                    10I 0 value

in the tutorial, you used a pointer field instead of the really big varying
options(*varsize) field for the returned record.

looking at the two examples, it almost looks to me that it's like six of
one, half a dozen of another.  in the first case, you are only passing
pointers and integers - very fast.  but once you have the return values,
you are still dealing with a field that is sized as the maximum size you
could recieve, with the trimming overhead that implies.

in the second, you are sending the entire size of the maximum field size,
but once you get it back, it's as small as the record size itself.

but after thinking about it, since the first example returns the record
length, it seems that it might be faster - once recieved, you could do
this:

D Record                 32765A   varying
D Line                   32765A

c               dow     1 = 1
c               eval    reclen = readline(fd: %addr(line): %size(line))
c               if      reclen < 1
c               leave
c               end
c               eval    Record = %substr(line:1:reclen)
-------> process record
c               enddo

and then you are working with a varing string, only the size of the actual
record.

even if I set the maxlen to 32765, i'm not passing that data back and
forth, and I immediatly reduce the field to a managable size.

what do you think?

> I'm always changing the way I do things, constantly trying different ways
> and different ideas, hoping to improve myself.

me too, although i rarely improve my techniques for processing speed, only
for coding speed and readability.  I hate looking at programs I wrote as
little as a year ago - i'm like... 'what the heck was I thinking?'

Thanks again,

Rick



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.