|
>From: rob@dekko.com >Date: Wed, 3 Oct 2001 14:35:07 -0500 > >Ok, I use List API's. In the generic header section it says how many list >entries there are, GHListNbr. What I want to do is: > >/free > // Initialize our offset to the offset of the list data. > pJobl0100=pGH0100 + GHListOff; > For 1 to GHListNbr; > cmd='SNDBRKMSG MSG(' + Apostrophe + %Trim(BrkMsg) + Apostrophe + > ') TOMSGQ(' + %trim(JLJobNam) + ')'; > qcmdexc(cmd:%len(%trim(cmd))); > pJobL0100=pJobL0100 + GHListMbrSz; > EndFor; Rob, processing the list this way will work 999 out of 1000 times, but on the thousandth time, you'll get MCH0601 (pointer offset) on the final iteration of your loop. You're incrementing the pointer one too many times. The best way to position the pointer is to use the loop control variable :) at the top of the loop code rather than the bottom. pGH0100List = pGH0100 + GHListOff; for listEntry = 1 to GHListNbr; pJobL0100 = pGH0100List + (listEntry - 1) * GHListMbrSz; ... endfor; Barbara Morris
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.