From: AarKayCee on
Hi all,

I'm new to Visual Objects language. Can anyone tell me why bulk
processing methods of class DBServer which accept code blocks do not
work. How to use fields of a server in for and while code blocks which
are passed in many methods of class DBServer.

Regards to all

AarKayCee
From: Geoff Schaller on
Show us the code you are using.

Otherwise it is a bit hard to tell you what you are doing wrong.



"AarKayCee" <aarkayci(a)gmail.com> wrote in message
news:9131b97c-5e5f-422c-9434-570a2983eb2b(a)m35g2000prn.googlegroups.com:

> Hi all,
>
> I'm new to Visual Objects language. Can anyone tell me why bulk
> processing methods of class DBServer which accept code blocks do not
> work. How to use fields of a server in for and while code blocks which
> are passed in many methods of class DBServer.
>
> Regards to all
>
> AarKayCee

From: Stephen Quinn on
AarKayCee

If you are changing the key field of an index or using scopes then you may
be moving the record outside the bounds of your indexing criteria, which
will put you at EOF for teh next record, so the FOR/WHILE exits early.

As Geoff said show us the code
ie how your creating the INDICES/TAGS and how your constructing the
codeblocks.

CYA
Steve


From: richard.townsendrose on
AarKayCee,

Code blocks are great for processing data when one is creating a table
of extracted data

we have about 15 tables which realte to technical documents, where
whgat when why how etc etc

heres one code block being set up ...

DO CASE // for Returns check if to be reported upon - check JobNo,
DocNo
CASE SELF:lIfByDocument .OR. (! SELF:lIfByDocument .AND.
SELF:oDCInfoLevel:Value = 'MOVES')
cbReturn:={|x,y|TRUE}
OTHERWISE
cJobNo:=SELF:oDCJobNo:Value
IF SELF:oDCInfoLevel:Value = 'DOCS'
cbReturn:={|x|!IsReturned(cJobNo,x,'')}
cFilterText:=cFilterText + CRLF + LoadResString('Outstanding
Returns',TG_OUTSTANDINGRETURNS,nPLH)
ELSE // = REVS
cbReturn:={|x| IsReturned(cJobNo,x,'')}
cFilterText:=cFilterText + CRLF + LoadResString('Returned
Documents',TG_RETURNEDDOCUMENTS,nPLH)
ENDIF
ENDCASE

and here's the data being parsed ... off a key table of revisions....
DO WHILE ! SELF:oDOCIV:EoF
ApplicationExec(EXECWHILEEVENT)
IF SELF:lCancelAnalysis
EXIT
ENDIF
cKey:=SubStr(cScope,1,9) + SELF:oDOCIV:FIELDGET(#MADEBY) +
SELF:oDOCIV:FIELDGET(#CLIENTDRG)
IF SELF:oDCRevSel:Value=='LATEST' // go to last
oDOCIV:Seek(cKey,FALSE,TRUE)
ENDIF

IF Eval(cbIssCode,
SELF:oDOCIV:FIELDGET(#DRGRESE)) .AND. ; // revision selectors
Eval(cbIssueDateC, SELF:oDOCIV:FIELDGET(#DATERECD)) .AND. ;
Eval(cbIssueDateRv,SELF:oDOCIV:FIELDGET(#REVDATE)) .AND. ;
Eval(cbSender, SELF:oDOCIV:FIELDGET(#RECVDFROM)) .AND. ;
Eval(cbReturn,
SELF:oDOCIV:FIELDGET(#DOCNO)) .AND. ; // returns
Eval(cbGroup, cKey)

IF Eval(cbStatCode, cKey ) .AND. ; // status analysis //
document selectors
Eval(cbMoreDets, cKey, SELF:aMoreInfo ) // more details

SELF:dwTest:=SELF:dwTest + 1 // count revs
IF ! cKey2 == cKey // count docs
SELF:dwTestD:=SELF:dwTestD + 1
ENDIF
SELF:oDCCountAns:Value:=NTrim(SELF:dwTestD) +'-' +
NTrim(SELF:dwTest)

IF ! lCountOnly // add record to Extracted DataFile
SELF:WriteRecord(cKey)
ENDIF

ELSE // Document fails - get ready for NEXT document
oDOCIV:Seek(cKey,FALSE,TRUE)
SELF:oDCCountAns:Value:=LoadResString('Skipped
Document',TG_SKIPPEDDOCUMENT,nPLH)
ENDIF

ENDIF

cKey2 := cKey
SELF:oDOCIV:Skip()
SELF:oDCProgSel:Advance(1)
SELF:oDCCountAns:Value:=NTrim(SELF:dwTestD) +'-' +
NTrim(SELF:dwTest)

ENDDO

dont forget the applicationexec unless you want the machine to go cold
on you when you may be processing [like we do] 50,000 records.

richard