Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Server:Sum() method and 5333 error

4 views
Skip to first unread message

Simon Goodman

unread,
May 9, 2001, 6:21:04 PM5/9/01
to
Hi All,

I've got a slight problem with a 5333 error that appears to be caused by
a for condition in the Sum() method.

I'm using VO2.5b1 (and cant move to 5b3 just yet).

The 5333 error message actually reports a problem in the Sum method -
although with a line number that doesn't exist.

I've listed what i think are the relevant parts of the method, and I
think that somehow the _FIELD->CC_HP is going out of scope or otherwise
getting lost.

Oh - kTSCC is a global Server opened at the start of the program. (I
know I shouldn't use a global server, but it is a very small app that
doesn't do very much!)

This method is called for each record change in the main windows server
and the 5333 comes up after moving through about 11 of the main records
- not a set number of records though.

The fields CC_HOURS1, CC_HOURS2, CC_HOURS3 and CC_HP are all fields
within the kTSCC DBF file.

Is there any way I can change the codeblock reference to the CC_HP field
to see if this is indeed the cause of my grief?

Sorry for such a long post - but I thought I had better explain as much
as I can.

Thanks for any help.

Simon.

METHOD BuildLV() CLASS Clock_Enq
LOCAL DIM aTotals[3] AS ARRAY

kTSCC:ClearScope()
kTSCC:OrderScope(TOPSCOPE,;
oDCmWeek:Value+SELF:Server:FIELDGET(#TSEM_CODE))
kTSCC:OrderScope(BOTTOMSCOPE,;
oDCmWeek:Value+SELF:Server:FIELDGET(#TSEM_CODE)+"99999999")

// When this line is in place the 5333 error comes up

// aTotals := kTSCC:Sum({#CC_HOURS1,#CC_HOURS2,#CC_HOURS3},;
// {||_FIELD->CC_HP="H"})

// With this line (no for codeblock) no 5333 error.
aTotals := kTSCC:Sum({#CC_HOURS1,#CC_HOURS2,#CC_HOURS3})

IF !Empty(aTotals)
oDCnTotRate1:Value := aTotals[1]
oDCnTotRate2:Value := aTotals[2]
oDCnTotRate3:Value := aTotals[3]
ENDIF
aTotals := NULL_ARRAY
kTSCC:GoTop()
DO WHILE !kTSCC:EoF
SELF:NewLVItem()
kTSCC:Skip(1)
ENDDO
oDCmLV:AutoSize()
SELF:oDCmLV:RestoreUpdate()
SELF:Pointer := WaitPoint(FALSE)
RETURN NIL


--
Simon Goodman

Bob Arnold

unread,
May 9, 2001, 6:40:32 PM5/9/01
to
Simon,

> Is there any way I can change the codeblock reference to the CC_HP
> field to see if this is indeed the cause of my grief?

Get the block to call a function where you can put an altd() - maybe
conditional upon a STATIC counter = 11, or whatever the problem count might
be. The function just has to return some form of the test: CC_HP="H".

HTH
Bob Arnold

"Simon Goodman" <Sim...@dev-soft.demon.co.uk> wrote in message
news:nla+SDAQ...@dev-soft.demon.co.uk...

Geoff Schaller

unread,
May 10, 2001, 6:33:43 AM5/10/01
to
Simon,

Its your order scopes (I think). Reduce them to a string first and then
assign the string to the scope (I assume they match the order). Remember
that what you pass must then be converted into a codeblock so will these
values make sense? Secondly, in the Sum(), ditch the code block and use
"CC_HP='H'" instead.

Geoff

Pavel Vetesnik

unread,
May 11, 2001, 6:31:51 AM5/11/01
to
Hi Simon,

just a silly question: Didn't you try to write the condition as character
expression and not using the codeblock? Like
aTotals :=
kTSCC:Sum({#CC_HOURS1,#CC_HOURS2,#CC_HOURS3},"_FIELD->CC_HP='H'").

BTW after reading SDK how DBServer:Methods() are really compiled, I started
using BD... functions for such batch processing. The code is easier to read,
faster and more stable. I can recommend you the same thing.
--
Pavel

PO-NOR-KA, sdruzeni podnikatelu
Sokolovska 260, 190 00 Praha 9
tel/fax: +420(2)684-36-52, http://www.po-nor-ka.cz

"Simon Goodman" <Sim...@dev-soft.demon.co.uk> wrote in message
news:nla+SDAQ...@dev-soft.demon.co.uk...

0 new messages