home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.paradox      To crash or not to crash, asks Borland      9,834 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 8,198 of 9,834   
   Jean Friedberg to Craig   
   Re: SetGenFiltered TCursor and movetoRec   
   20 Feb 07 09:06:29   
   
   From: jfriedberg@mycomcast.com   
      
   Craig,   
      
   Make a secondary index on the main table with Patient Number and Admission   
   DateTime.  Add a field called "Last Discharge DateTime" to the table.  Add a   
   second field called "Elapsed Hours".   
      
   Query the table to generate a unique set of Patient Numbers.  Use a tcursor   
   to scan this table of Patient Numbers.   
      
   Set up a second tcursor on your main table.  Using tcursor #1, use set range   
   to isolate Patient Number.  Use tcursor #2 to scan the resulting set of   
   records and fill/calculate in the "Last Discharge DateTime" and "Elapsed   
   Hours" fields.  Come back to the newsgroup if you need help calculating   
   Elapsed Hours.   
      
   Finally, query the main table for Elapsed Hours less than target value   
   (e.g., 48 hours) to generate those instances in which the patient bounced   
   back.   
      
   Time to write the code and run it should be less than 15 minutes.   
      
   Jean   
      
   "Craig"  wrote in message   
   news:45d7aa38$1@pnews.thedbcommunity.com...   
   > In the following code snippet, the TCursor dosen't move to the next record   
   > which is record lio+1   
   > The code steps through the line with the errorshow, but it doesn't show   
   the   
   > error..   
   > This is part of a Scan Loop with a different TCursor (P10)   
   >   
   > Thanks in advance.   
   > Craig   
   >   
   >    
   >      dyn["HospitalNumber"] = stNewMR   
   >       tcBounce1.setGenFilter(dyn)   
   >       licount = TCBounce1.nrecords()   
   >   
   >       If licount <2 then;// if less than 2 records nothing to   
   compare..move   
   > on to next patient   
   >         Loop   
   >      ENDIF   
   >   
   >       For lio from 1 to liCount-1   
   >       TCBounce1.movetoRecord(lio)   
   >        dtDCDatetime   = TCBounce1."DCdateTime"   
   >        If not TCBounce1.movetoRecord(lio+1) then ;// <---this does not   
   > happen!!!!   
   >          errorshow("Could not move to record "+STrval(lio +1));// <-- the   
   > errorshow show doesn't show   
   >          return   
   >       Else   
   >        dtAdmitDateTime = TCBounce1."AdmitDateTime"   
   >        ENDIF   
   >    
   >   
   >   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca