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



On Thu, 2006-01-12 at 08:58 -0800, Douglas W. Palme wrote:
> I am still having a problem with overwriting subfile A after receiving a 
> selection from subfile B (windowed subfile).
> 
> Here are the steps I am going through:

I like to have 5-8 in a separate module, with it's own display file.
Then I can reuse the window everywhere.

All of my search functions take a window title, and return a boolean
indicating whether a record was selected.  In addition, they use two way
parameters to indicate the actual key to the selected record, the record
description, and a field indicating which command function key was last
pressed.  


      * Search for physician module - prototype
     d search_phy      pr              n
     d  wdw_title                    25a   const
     d  o_docid                       5p 0
     d  o_dlnam                      20a
     d  o_dfnam                      12a
     d  o_dinit                       1a
     d  o_cfkey                       1a






     p handle_prompt   b
     d handle_prompt   pi              n

     d $docid          s              5p 0
     d $dlnam          s             20a
     d $dfnam          s             12a
     d $dinit          s              1a
     d $diagid         s              5a
     d $diagds         s             24a
     d $dispid         s              1a
     d $dispds         s             35a
     d $key            s              1a

      /free
         select;
             when csr_field = 'XAADOC';
                 if search_phy('Attending Doctor':
                            $docid: $dlnam: $dfnam: $dinit: $key);
                     xaadoc = $docid;
                     xaanam = %trim($dlnam) + ', ' + %trim($dfnam) + ' ' +
                              $dinit;
                 endif;
             when csr_field = 'XFMDOC';
                 if search_phy('Family Doctor':
                            $docid: $dlnam: $dfnam: $dinit: $key);
                     xfmdoc = $docid;
                     xfmnam = %trim($dlnam) + ', ' + %trim($dfnam) + ' ' +
                              $dinit;
                 endif;
             when csr_field = 'XAADG1';
                 if search_diag('Admitting Diagnosis':
                            $diagid: $diagds: $key);
                     xaadg1 = $diagid;
                     xadia1 = $diagds;
                 endif;
             when csr_field = 'XADCCD';
                 if search_disp('Discharge Disposition':
                            $dispid: $dispds: $key);
                     xadccd = $dispid;
                     xadcds = $dispds;
                 endif;
         endsl;

         return $key;
      /end-free
     P                 e

> 6. Upon return execute a READC to check for any user selections.
> 
> 7. Chain to subfile A based on the RRN and then move the new GL account 
> number to the appropriate field on subfileA
> 
> 8. update subfile A.
> 
> 9. Control now drops all the way back to the main procedure which loops back 
> to EXFMT subfile A.
> 
> >From what I can tell in theory everything should work, but when it 
> redisplays subfile A it blanks out all fields with the exception of the GL 
> account number.
On all screen fields?  Or perhaps only on that row, or on all rows in
the subfile?  
> 
> Suggestions? Hints? Tell me to change jobs? :)
Are you sure that your code only updated the one field?

In debug, check after the chain to subfile A as to what the field values
are.  Was the chain successful?  Did you get the expected field values?

Just prior to updating subfile A, check to see what the values of the
subfile fields are.  Could you be running a bit of code that clears
those fields?

IMO, the update of subfile A should be very close to the chain.  Since
subfile fields are global to the application, it's very easy to blank
them out, or change them, especially if the subfile fields match those
of an existing file used in the program.

chain somenumber subfile;
if %found(subfile);
    some_subfile_field = some_other_field;
    update subfile;
endif; 


Regards,
Rich


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.