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



Well, then I must be running into a different bug. As far as I knew, if the 
key value supplied to SETGT is greater than or equal to the highest key 
value, %FOUND is not turned on, and the file cursor is not repositioned. If 
it were always repositioned, then apparently %FOUND would always be on, in 
contradiction to what is in "The Modern RPG VI Language, Third Edition", 
page 355. The code I am using below repeats endlessly if the account number 
(represented by CI.Family# and CI.Member#) is the highest value in the file. 
I have verified the error data and found that the key value it attempts to 
replace (Mmseq#) is 1, while the account in question has two memos, sequence 
1 and 2. 

The only possibility is that
1) The SetGT is failing, due to there being no greater key values
2) The ReadPE is failing, due to the failure of the positioning
3) Sequence 1 is used. The only way sequence 1 would be used (assuming there 
is no sequence zero, and I verified this) is this. 

Dou Not %Error;

// Find next memo seq# for member
SetGT(E) (CI.Family#:CI.Member#) Mmemo_I;
ReadPE(E) (CI.Family#:CI.Member#) Mmemo_I MI;

If %Found(Mmemo_I);
MO.Mmseq#=MI.Mmseq#+1;
Else;
MO.Mmseq#=1;
EndIf;

Write(E) Mmorec MO;
EndDo;

On 8/25/05, Rich Duzenbury <rduz-midrange@xxxxxxxxxxxxxxxxxxx> wrote:
> 
> Just to be sure, I ran it in debug.
> 
> With the test code I presented, *every* record is added to the end of
> the file.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.