Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Clipper Visual-Objects > Could there be ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 11277 of 11795
Post > Topic >>

Could there be a issue with this bBrowser selection routine?

by D.J.W. van Kooten <public@[EMAIL PROTECTED] > Apr 3, 2008 at 08:58 AM

We use a method  SelectItemFromBB, see below, to retrieve either an
array of record numbers or values of a key of currently selected
bBrowser lines. Although it works 10.000 of times, we had a very odd
issue which makes me wondering if the code below could go wrong.

First, we call this method and add the recordnumbers in a temp
database passed to a re****t to print a packing slip. The customer sent
us a PDF where the 16 lines have partly been duplicated. Not that they
are just printed a second time, we see 1-6 ok, then it repeats 1 and
6, then 9-16 ok and then some random repeats. 

A logic explanation is that the temp database wasn't properly zapped
but from logging we found (within a short time when several action
have been performed on the selection) that every of this action, each
calling the method SelectedBBItems  again, the same order and
incorrect selection of records has been used in methods like
self:DoSomethingWithThisRecordAndLogIt() in the code below. We can see
without doubt that the same record has been used in the for-next for
12 out of 16 items printing, reserving for delivery and ****pping those
12 items double.

We've studied it in length but could not find any other explanation
than that SelectedBBItems was able to add records a second time in the
array it returns. But we have no idea how....

It can be avoided (adding an ascan) but we just wondered: could there
be anything in the code below causing it? Or does someone have this
experience as well?

Dick van Kooten

The method is called a few times like this:

ASel := SELF:SelectedBBItems (SELF:oDCbBrowser, #Anyfield, TRUE)
nLen:=ALen(aSel)

FOR ni:= 1 UPTO nLen
	olServer:Goto(aSel[ni])
	self:DoSomethingWithThisRecordAndLogIt()....// this used and
logged that 12/16 records where used twice
NEXT



METHOD SelectedBBItems (oControl, sSymCol, lReturnRecnos) CLASS Window
//#s Returns array with selected bBrowser items Added in class
1-9-2004
//#p oControl=bBrowser; symcol = column to return array lReturnRecnos

LOCAL nRecNo AS DWORD
LOCAL aValues := {} AS ARRAY
LOCAL uRecord AS USUAL
                  
uRecord := oControl:RecordSave() // Keep current  record
oControl:Server:SuspendNotification ()
nRecNo := oControl:SelectionFirstRow ()
DO WHILE nRecNo > 0
	IF lReturnRecnos
		AAdd (aValues, nRecno)
	ELSE
		oControl:Server:GoTo (nRecNo)
		AAdd (aValues, oControl:Server:FIELDGET (sSymCol))
	ENDIF	
	nRecNo := oControl:SelectionNextRow ()
ENDDO
oControl:RecordRestore(uRecord) // Restore record
oControl:Server:ResetNotification ()
RETURN aValues
 




 5 Posts in Topic:
Could there be a issue with this bBrowser selection routine?
D.J.W. van Kooten <pub  2008-04-03 08:58:14 
Re: Could there be a issue with this bBrowser selection routine?
"EŽ!k \\/!sser"  2008-04-03 10:32:52 
Re: Could there be a issue with this bBrowser selection routine?
D.J.W. van Kooten <pub  2008-04-03 11:28:28 
Re: Could there be a issue with this bBrowser selection routine?
"EŽ!k \\/!sser"  2008-04-03 12:28:03 
Re: Could there be a issue with this bBrowser selection routine?
"Paul D B" <  2008-04-03 16:43:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 17:56:29 CST 2008.