main logo
Subject: Re: [VJDK 1.8.8] A puzzler
Author: Ruslan Zasukhin
Posted: 2001/05/30 03:59:29
 
View Entire Thread
New Search


on 5/30/01 8:20, Scott Steinman at steinman (AT) sco .D.O.T edu wrote:

> --
> This short code segment is pretty simple. It should start with the
> first record of a BaseObject called ScoreDxDB (it's used to score the
> diagnoses of a patient by a student), then loop through the diagnosis
> records until no more records are present:
>
> try
> {
> getScoreDxDB().FirstRecord();
>
> long numRecs = getScoreDxDB().GetRecordCount(); //
> Confirms that 10 records are present
>
> do
> {
>
> long recID = getScoreDxDB().GetRecID(); // Which
> record are we working on?
>
> // ALL FOLLOWING CODE ONLY READS FIELDS
>
> if ( isIcd9Defined(
> getScoreDxDB().getIcd9() ) ) // Is student's Icd9 field > 0?
> {
> float userIcd9 = getScoreDxDB().getIcd9();
> // Use student's Icd9 code
>
> if ( isMatchWithExpert( userIcd9 ) ) //
> Does it match expert's Icd9 code?
> {
> // all code here commented out during testing
> }
> else
> {
> // all code here commented out during testing
> }
> }
>
> } while ( getScoreDxDB().NextRecord() );
> }
> catch ( VException vx )
> {
> ....
> }
>
> The strange thing: the record pointer never gets moved past the first
> iteration of the loop!! The variable recID stays stuck at 2 and the
> loop never exits. Am I just missing something blatently obvious here?
> I've used this same program logic elsewhere and it's worked just
> fine. It's just this particular loop that fails.
>
> I'd appreciate any help that's offered.

just to get more info:

try to do for this cursor BEFORE loop:

LastRecord()

and

FirstRecord
Next
Next

does Next return you false ?

does viSQL show this BaseObject with no problems ?


--
Best regards,
Ruslan Zasukhin

-------------------------
Paradigma.

e-mail: ruslan@paradigmasoft.com
web : http://www.paradigmasoft.com

To subscribe to the Valentina mail list
send a letter to valentina-on (AT) lists .D.O.T macserve.net



-------------------------------------------------------------
The Valentina mailing list is brought to you by MacServe.net
For info on lists services, see http://www.macserve.net/lists.html
 
©2001 Ruslan Zasukhin
<-- Prior Message New Search Next Message -->