Home > Archive > Getting Started with dBASE > November 2006 > unusual error









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author unusual error
dlit

2006-11-14, 5:17 am

A very usual routine and unusual error :
The routine :
- do while not eof
- store field value into declared variable
- do something
- skip
- enddo

The error message : Database engine error - operation not applicable

This error message comes on the change of the value of the variable.(step 2 of the routine). If (after clicking Suspend) I make the change manually in the command window with same syntax as in the routine, no error message pops up. Where is the problem ?


Another tip : when typing ? variable and ? datafield in the command window, they are displayed differently in the lower pane :
? variable is displayed :" xx"
? datafield is displayed: "xx"
both being numeric.

A last point I have hundreds of prgs where this type of routine is probably working and the same prg under dbIV is working perfectly well for years.

Thanks for advice.
Dom


Ken Mayer [dBVIPS]

2006-11-14, 7:15 pm

dlit wrote:
> A very usual routine and unusual error :
> The routine :
> - do while not eof
> - store field value into declared variable
> - do something
> - skip
> - enddo
>
> The error message : Database engine error - operation not applicable
>
> This error message comes on the change of the value of the variable.(step 2 of the routine). If (after clicking Suspend) I make the change manually in the command window with same syntax as in the routine, no error message pops up. Where is the problem

?
>
> Another tip : when typing ? variable and ? datafield in the command window, they are displayed differently in the lower pane :
> ? variable is displayed :" xx"
> ? datafield is displayed: "xx"
> both being numeric.
>
> A last point I have hundreds of prgs where this type of routine is probably working and the same prg under dbIV is working perfectly well for years.


How about showing the *actual* code, rather than just pseudo-code?

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
dlit

2006-11-17, 7:12 pm

Here it is with its 2 tables. The problem concerns the reinitialization of a variable with a new value. I meet the same problem with other routines.
Dom

Ken Mayer [dBVIPS] Wrote:

> dlit wrote:
m ?[color=darkred]
>
> How about showing the *actual* code, rather than just pseudo-code?
>
> Ken
>
> --
> /(Opinions expressed are purely my own, not those of dataBased
> Intelligence, Inc.)/
>
> *Ken Mayer* [dBVIPS]
> /Golden Stag Productions/
> dBASE at goldenstag dot net
> http://www.goldenstag.net/dbase/dBASEBook.htm
> http://www.goldenstag.net/GSP
> http://www.goldenstag.net/dbase



Ken Mayer [dBVIPS]

2006-11-17, 7:12 pm

dlit wrote:
> Here it is with its 2 tables. The problem concerns the reinitialization of a variable with a new value. I meet the same problem with other routines.
> Dom


Well, I actually meant just extracting the code that is the problem and
copying it into the message ...

Where exactly in the code is the problem? I am not that great at
debugging other people's code (heck, I sometimes wonder about my own ...).

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
dlit

2006-11-18, 7:12 pm

The error message occurs on the line "SMR=SEMRET"
I think the cause of the bug is a whole, I mean is linked to the whole of participating elements. That is why I posted this extract of my routine, with adapted tables working with it, so that one can experiment by oneself the bug if desired.
I ll be most interested by any comments as this is sort of a riddle...
Dom


Ken Mayer [dBVIPS] Wrote:

> dlit wrote:
>
> Well, I actually meant just extracting the code that is the problem and
> copying it into the message ...
>
> Where exactly in the code is the problem? I am not that great at
> debugging other people's code (heck, I sometimes wonder about my own ...).
>
> Ken
>
> --
> /(Opinions expressed are purely my own, not those of dataBased
> Intelligence, Inc.)/
>
> *Ken Mayer* [dBVIPS]
> /Golden Stag Productions/
> dBASE at goldenstag dot net
> http://www.goldenstag.net/dbase/dBASEBook.htm
> http://www.goldenstag.net/GSP
> http://www.goldenstag.net/dbase


dlit

2006-11-21, 7:13 pm

dlit Wrote:

> The error message occurs on the line "SMR=SEMRET"
> I think the cause of the bug is a whole, I mean is linked to the whole of participating elements. That is why I posted this extract of my routine, with adapted tables working with it, so that one can experiment by oneself the bug if desired.
> I ll be most interested by any comments as this is sort of a riddle...
> Dom
>


Anyway for immediate reading, here is the core of the routine itself:
//TESTB
SELECT B
USE TESTB
GO TOP
DO WHILE .NOT. EOF()
*? noliv,semret
*wait
RSM=SEMRET
MIL=ANNEE

SELECT A
USE CAL&MIL
GO TOP
LOCATE FOR SEM=RSM
DTL=DDATE

IF RSM>1
go top
LOCATE FOR SEM=RSM-1
ENDIF

DTX=DDATE

IF RSM>2
go top
LOCATE FOR SEM=RSM-2
ENDIF

DTC=DDATE

IF RSM>3
go top
LOCATE FOR SEM=RSM-3
ENDIF

DTS=DDATE
? DTL,DTX,DTC,DTS

SELECT B
IF .NOT. empty(DTL)
*={}
REPLACE DDATLIV WITH DTL

IF DDATLIV<DATE()
REPLACE DDATLIV WITH DATE()
ENDIF

IF DATEXP<DATE()
REPLACE DATEXP WITH DATE()

ELSE

REPLACE DATEXP WITH DTX
ENDIF

IF .NOT. empty(DATESPEC)
*={}

IF DATESPEC<DATE()
REPLACE DATESPEC WITH DATE()

ELSE

REPLACE DATESPEC WITH DTS
ENDIF

ENDIF

IF .NOT. empty(DATELC)
*={}

IF DATELC<DATE()
REPLACE DATELC WITH DATE()

ELSE

REPLACE DATELC WITH DTC
ENDIF

ENDIF

ENDIF

SKIP
ENDDO

RETURN


>
> Ken Mayer [dBVIPS] Wrote:
>
>


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com