Validation of Data within the same file being changed
Quote:
>>I have a data validation need that is a little unusual (i think so anyway
>><g>).
>>Whenever I add or change data in this file, I need to read in the rest of
>>that file (only those records for a given customer) and perform a complex
>>error checking routine that involves reading other files. This error
>>checking process seems to goof up the changes in process (either the add or
>>change record).
>>I thought, OK, maybe a read of the file before the data is officially saved
>>by closing the form is somehow goofing up the SAV:Record (is this the
>>term?) for the add/change. So I created an ALIAS file of this file and
>>read that to do the error checking. This does not seem to work because
>>when I do a SET(file,key) after priming for the customer of interest, I
>>only seem to be able to find one record for that customer - even though I
>>know there is more than one. Yes, the key is customer based with CustID as
>>the first component.
>>HELP !! I am stumped. If I can't figure this out, I will probably opt for
>>the stupid way out - build a queue before the data is accessed for the
>>change/add, and don't look at the file again during the process. There
>>must be a more elegant/efficient way though. Any ideas ???
>>BTW, the CW printed manuals contradict themselves in the VIEW section - one
>>part says a SET must issued BEFORE the file is opened and several pages
>>later says to SET AFTER opening the file.
You can just create an ALIAS of the file in the dictionary so that you
have another record buffer to use. That way you can check the file
against itself without losing any record positions that you are
currently on.
Jeff Slarve [Team Topspeed(CW)(Compuserve)]
(CW2002, DET 2.2, RPM, PwrBrw, CPCS, PDLookup, UlTree, G-Reg, etc.) Since 1991
J & S Software Co. http://www.deltanet.com/users/jslarve
(CIS: 73501,1323) Using Agent .99g and loving it!