Fair question. That's VFP9. I was going to try it in VFPA if it failed in
VFP9 to see if that fixed the issue but since it didn't fail I haven't
bothered.

Update: It works fine in VFPA too.

On Thu, Nov 21, 2019 at 12:04 PM Tracy Pearson <[email protected]>
wrote:

> Eric,
>
> Now, is that in VFP 9 SP 2, or VFP Advanced?
>
> Tracu
>
> -----Original Message-----
> From: ProfoxTech [mailto:[email protected]] On Behalf Of Eric
> Selje
> Sent: Thursday, November 21, 2019 12:59 PM
> To: [email protected]
> Subject: Re: Fatal error issuing CALCULATE command
>
> This tweak adds rows so there's something to actually calculate. I tried it
> with many variations on fields and rows and cannot get it to crash.
>
> #DEFINE _fields 35
> #DEFINE _rows 100
> =RAND(-1)
> CREATE CURSOR crsTest (id i)
> cCalcCmd = [CALCULATE ]
> cInsertFields = []
> cInsertValues = []
> FOR x = 1 TO _fields
>    cField = "Field"+TRANSFORM(x)
>    ALTER table crsTest ADD COLUMN (cField) I
>    cCalcCmd = cCalcCmd + "SUM("+cField+"),"
>    cInsertFields = cInsertFields + ","+cField
>    cInsertValues = cInsertValues + ","+TRANS(INT(RAND()*100))
> NEXT
> cInsertCmd = [INSERT INTO crsTest (ID ] + cInsertFields +[) VALUES
> (0]+cInsertValues+')'
> FOR X = 1 TO _rows
>    &cInsertCmd
> NEXT
> cCalcCmd = cCalcCmd + "AVG(Field1)"
> &cCalcCmd
>
>
>
> On Thu, Nov 21, 2019 at 11:37 AM Tracy Pearson <[email protected]>
> wrote:
>
> > Paul,
> > There is no data in the cursor he created.
> > How many records are you SUMming?
> >
> > Tracy
> >
> >
> > -----Original Message-----
> > From: ProfoxTech [mailto:[email protected]] On Behalf Of Paul
> > Newton
> > Sent: Thursday, November 21, 2019 11:29 AM
> > To: [email protected]
> > Subject: RE: Fatal error issuing CALCULATE command
> >
> > Hi Eric
> > I think that's because the limit is 32 (not 31 as I stated).  Try using
> For
> > x = 1 To 33 and I think you will get the problem.  Please let us know
> > Thanks
> > Paul Newton
> >
> > -----Original Message-----
> > From: ProfoxTech <[email protected]> On Behalf Of Eric Selje
> > Sent: 21 November 2019 16:17
> > To: [email protected]
> > Subject: Re: Fatal error issuing CALCULATE command
> >
> > Sent by an external sender
> > ------------------------------
> >
> > Interesting. I whipped up this test and cannot replicate the problem:
> > CREATE CURSOR crsTest (id i)
> > cCmd = [CALCULATE ]
> > FOR x = 1 TO 32
> >    cField = "Field"+TRANSFORM(x)
> >    ALTER table crsTest ADD COLUMN (cField) I
> >    cCmd = cCmd + "SUM("+cField+"),"
> > NEXT
> > cCmd = cCmd + "AVG(Field1)"
> > &cCmd
> >
> >
> > On Thu, Nov 21, 2019 at 9:50 AM Paul Newton <[email protected]>
> > wrote:
> >
> > > Hi all
> > >
> > > I think I have come across a possibly undocumented limitation to the
> > > maximum number of expressions in a CALCULATE command.  In my case a
> > > fatal error occurred when trying to CALCULATE the SUMs of 32 different
> > > fields in a cursor.  It took a while to establish what was going on,
> > > but when I reduced the number of expressions to 31 the error no longer
> > occurred.
> > >
> > > Has anybody else encountered this issue?  Many thanks
> > >
> > > Paul Newton
> > >
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/caawxvunhwqwo+0bqvl7yherofsfm2xwcdmqxz4env6c6pla...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to