1 Jul 2003 04:40
Re: Duplicate Record bug
Peter,
as I already suggested, I would do that stuff with arrarys.
That's special in a multiuser environment more efficient. But it depands
on the number of records you want to work on.
Am/On: Tue, 1 Jul 2003 04:27:26 +0200 schrieb/wrote: Peter Peter Mannheim
>thanx for the caveats about sets going 'stale'.
>In my particular scenario, I misdirected the iNug about what I did -
>emailing in a hurry!
>
>Actual code to process the Line Items after I had ticked the ones due for
>'Refund' was:
> QUERY([LineItems];[LineItems]Appro ID=[Invoices]Appro Number)
> CREATE SET([LineItems];"Line Set")
> FIRST RECORD([LineItems]) ` possibly unnecessary
Yes this is unnecessary here.
> For ($i;1;Records in selection([LineItems]))
> Case of
> : ([LineItems]Refund=True)
> ` do stuff to process totals etc.
> : ([LineItems]Refund=False)
> REMOVE FROM SET([LineItems];"Line Set")
> DELETE RECORD([LineItems])
> End case
> NEXT RECORD([LineItems])
> End for
> USE SET("Line Set")
> CLEAR SET("Line Set")
>` and so I save just the records that have Refunds due...
>
>- might I have problems in a multi-user environment, I wonder ?
You have to check whether the record is locked by another user or not.
But you have tools like semaphores to tell other processes, "don't touch
these records now".
All the Best
Matthias
---------------------------------
schmidt-systementwicklung
<www.schmidt-system.com>
---------------------------------
**********************************************************************
4th Dimension Internet Users Group (4D iNUG)
FAQ: http://www.pdm-inc.com/iNUG/faq.htm
Admin: mailto:iNUG@...
Unsub: mailto:4D_Tech-off@...
**********************************************************************
RSS Feed