Home > Archive > Clipper > January 2006 > GPF in ALLOC_TEXT
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]
|
|
| Polihronis Porfiris 2006-01-10, 3:55 am |
| Hello to all. I'm getting a GPF from one of my apps. The GPF accurse while
indexing the main DBF for the first time. When I delete the CDX file and
restart the app there is no GPF. From the MAP file the GPF address is
somewhere in ALLOC_TEXT (0010:412F)
Code:
0010:3E04 00692H ALLOC_TEXT CODE
This is strange because I use the same technique in all my apps when
indexing. The code I use if as follows
Code:
STATIC cId1:="$Id: ADI_OPEN.PRG,v 1.1 2006/01/03 22:07:16 Exp
$"
#include "SIXCDX2.CH"
#include "FiveWin.ch"
#command INDEX ON <key> TAG <(tag)> [OF <(cdx)>]
;
[FOR <for>]
;
[ALL]
;
[ASCENDING]
;
[<dec: DESCENDING>]
;
[<u: UNIQUE>]
;
[<cur: USECURRENT>]
;
[<cur: SUBINDEX>]
;
[EVAL <opt> [EVERY <step>]]
;
[OPTION <opt> [STEP <step>]]
;
[<add: ADDITIVE>]
;
[<filt: FILTERON>]
;
=>
;
m6_ordCondSet(<"for">, <{for}>, NIL, NIL, <{opt}>,
;
<step>, RECNO(), NIL, NIL, NIL, [<.dec.>],
;
.T., <(cdx)>, <.cur.>, .F., NIL, <.add.>, NIL,
;
<.filt.> )
;
; m6_ordCreate( <(cdx)>, <(tag)>, <"key">, <{key}>, [<.u.>] )
FUNCTION OpenDbfs()
PRIVATE oDlg1,;
oMeter1,;
nMeter1 := 0,;
oMeter2,;
nMeter2 := 0,;
lRetVal := .F.,;
oOpenIco,;
lDlgKill
lDlgKill := .F.
DEFINE DIALOG oDlg1 NAME "FLS_OPEN";
FONT oMainFont OF oMainWin;
COLOR CLR_BLACK, CLR_HGRAY
REDEFINE BITMAP ID 101 NAME "FILES04" OF oDlg1
REDEFINE METER oMeter1 VAR nMeter1 ID 102 TOTAL 7 OF oDlg1 COLOR
CLR_WHITE, CLR_BLACK BARCOLOR CLR_BLUE, CLR_WHITE
REDEFINE METER oMeter2 VAR nMeter2 ID 103 TOTAL 7 OF oDlg1 COLOR
CLR_WHITE, CLR_BLACK BARCOLOR CLR_BLUE, CLR_WHITE
oDlg1:bStart := {|| FileOpn()}
ACTIVATE DIALOG oDlg1 VALID lDlgKill CENTER
CursorArrow()
RETURN lRetVal
STATIC FUNCTION FileOpn()
CursorWait()
SELECT 1
IF !FILE("ADIBOOK.DBF")
MSGStop(OemToAnsi("' ~Ro $ ~>o $ f"O TYzo!!!" +CRLF+;
"Y>? ~ s~~"),
OemToAnsi("R"))
lRetVal := .F.
ELSE
oMeter1:cText := OemToAnsi("?Ro ADIBOOK.DBF")
oMeter1:Set(nMeter1 + 1)
SysRefresh()
USE ADIBOOK VIA "SIXCDX" ALIAS ADBK PASSWORD (cADIPwd)
IF !FILE("ADI_BAG1.CDX")
oMeter2:nTotal = RecCount()
oMeter2:Set( 0 )
SET ORDER TO 0
DBGOTOP()
oMeter2:cText := OemToAnsi("fz s~ "oz妬 1/6")
oMeter1:Set(nMeter1 + 1)
INDEX ON SUBSTR(ADBK->ADI_DATE, 1, 4) + ADBK->ADI_NUM +
ADBK->ADI_EPIPL TAG ADI_1001 OF ADI_BAG1.CDX OPTION ( oMeter2:Set(
RecNo() ), SysRefresh(), .T. ) STEP 10
oMeter2:Set( 0 )
SET ORDER TO 0
DBGOTOP()
oMeter2:cText := OemToAnsi("fz s~ "oz妬 2/6")
oMeter1:Set(nMeter1 + 1)
INDEX ON ADBK->ADI_DATE TAG ADI_1002 OF ADI_BAG1.CDX OPTION (
oMeter2:Set( RecNo() ), SysRefresh(), .T. ) STEP 10
oMeter2:Set( 0 )
SET ORDER TO 0
DBGOTOP()
oMeter2:cText := OemToAnsi("fz s~ "oz妬 3/6")
oMeter1:Set(nMeter1 + 1)
INDEX ON ADBK->ADI_NAME + ADBK->ADI_DATE TAG ADI_1003 OF
ADI_BAG1.CDX OPTION ( oMeter2:Set( RecNo() ), SysRefresh(), .T. ) STEP 10
oMeter2:Set( 0 )
SET ORDER TO 0
DBGOTOP()
oMeter2:cText := OemToAnsi("fz s~ "oz妬 4/6")
oMeter1:Set(nMeter1 + 1)
INDEX ON ADBK->ADI_ADDRES + ADBK->ADI_DATE TAG ADI_1004 OF
ADI_BAG1.CDX OPTION ( oMeter2:Set( RecNo() ), SysRefresh(), .T. ) STEP 10
oMeter2:Set( 0 )
SET ORDER TO 0
DBGOTOP()
oMeter2:cText := OemToAnsi("fz s~ "oz妬 5/6")
oMeter1:Set(nMeter1 + 1)
INDEX ON ADBK->ADI_TYPE + ADBK->ADI_DATE TAG ADI_1005 OF
ADI_BAG1.CDX OPTION ( oMeter2:Set( RecNo() ), SysRefresh(), .T. ) STEP 10
oMeter2:Set( 0 )
SET ORDER TO 0
DBGOTOP()
oMeter2:cText := OemToAnsi("fz s~ "oz妬 6/6")
oMeter1:Set(nMeter1 + 1)
INDEX ON ADBK->ADI_OT + ADBK->ADI_DATE TAG ADI_1006 OF
ADI_BAG1.CDX OPTION ( oMeter2:Set( RecNo() ), SysRefresh(), .T. ) STEP 10
ENDIF
SET INDEX TO ADI_BAG1
SET ORDER TO TAG ADI_1001 OF ADI_BAG1
DBGOTOP()
lRetVal := .T.
ENDIF
lDlgKill := .T.
CursorArrow()
oDlg1:end()
RETURN
FUNCTION V_Open()
RETURN cId1
The DBF has the following structure.
Code:
Field Field Name Type Width Dec. Begin End
1 ADI_NUM Character 4 1
4
2 ADI_EPIPL Character 1 5
5
3 ADI_DATE Character 8 6
13
4 ADI_NAME Character 60 14
73
5 ADI_ADDRES Character 60 74
133
6 ADI_TYPE Character 30 134
163
7 ADI_OT Character 6 164
169
8 ADI_NOTES Character 81 170
250
The error accurse between the 3rd and 4th TAG. The DBF has about 13950
records. It's size is 3.3MB and it's encrypted using SIX 3.02 RDD.. This app
uses 3 DBF files a text file that opens and closes when needed and 3-4 CDX
index files.
This is strange since an other app that I have uses 5 DBFs and 10-14 CDX
files and there is no GPF during index procedures, both when there is no
file found and when a remake is needed.
Is this clipper or fivewin relative. And how can I solve it
I'm using clipper 5.2e, blinker 6, six 3.02 and fivewin 2.4
Thanks
| |
| Stephen Quinn 2006-01-10, 3:55 am |
| Polihronis
What happens if you limit the size of your index key in the following expression
> INDEX ON ADBK->ADI_ADDRES + ADBK->ADI_DATE TAG ADI_1004 OF
> ADI_BAG1.CDX OPTION ( oMeter2:Set( RecNo() ), SysRefresh(), .T. ) STEP 10
Eg.
INDEX ON LEFT( ADBK->ADI_ADDRES, 20 ) + ADBK->ADI_DATE TAG ADI_1004
Suggestion
Don't use the ALIAS in the index expressions, use field a statement at the top
of your function
Eg
FIELD ADI_ADDRES, ADI_DATE, etc... IN ADBK
INDEX ON ADI_ADDRES + ADI_DATE TAG ADI_1004
The following 2 statements are NOT required between each INDEX call
> SET ORDER TO 0
> DBGOTOP()
If you called your index
ADIBOOK.CDX
you could drop the following from your INDEX statements
OF ADI_BAG1.CDX
and avoid the use of SET INDEX altogether.
See the sixdriver docs on using structural index files
- ie index files with the same name as the DBF
HTH
Steve
| |
| Polihronis Porfiris 2006-01-10, 3:55 am |
| Hello Stephen.
If I shave off the last 10 chars from the name and address fields
(SUBSTR(ADI_NAME, 1, 50) and SUBSTR(ADI_ADDRES, 1, 50)) all is ok. There is
no GPF on first index and or when that CDX must be remade at startup. Doing
a search of the DBF to see how long are the fields I saw that the largest
values where around 55 and 48 chars for each field so I think the last 10
shaved chars are ok.
As for the statements
SET ORDER TO 0
DBGOTOP()
I use them to reset the DBF to its natural order so that I can update the
second meater bar using the current recno being indexed
OPTION ( oMeter2:Set( RecNo() ), SysRefresh(), .T. ) STEP 10
Otherwise I would have to make a function that handles a static counter
(more code and mem)
Im using the OF <CDX_Name> bexause in the filter section of the app I
change bags to ADI_BAG3.CDX which is the same 6 tags but with a FOR clause
that is generated at runtime (e.g. ADI_NAME >= aFilterLst[1,1] .AND.
ADI_NAME <= aFilterLst[1,2]).
Thanks for your help.
"Stephen Quinn" <steveq@NOSPAMintegritynet.com.au>
news:oRZuf.170181$V7.142438@news-server.bigpond.net.au...
> Polihronis
>
> What happens if you limit the size of your index key in the following
> expression
>
>
> Eg.
>
> INDEX ON LEFT( ADBK->ADI_ADDRES, 20 ) + ADBK->ADI_DATE TAG ADI_1004
>
> Suggestion
> Don't use the ALIAS in the index expressions, use field a statement at the
> top of your function
> Eg
> FIELD ADI_ADDRES, ADI_DATE, etc... IN ADBK
> INDEX ON ADI_ADDRES + ADI_DATE TAG ADI_1004
>
> The following 2 statements are NOT required between each INDEX call
>
> If you called your index
> ADIBOOK.CDX
> you could drop the following from your INDEX statements
> OF ADI_BAG1.CDX
> and avoid the use of SET INDEX altogether.
>
> See the sixdriver docs on using structural index files
> - ie index files with the same name as the DBF
>
> HTH
> Steve
>
| |
| AUGE_OHR 2006-01-10, 3:55 am |
| hi,
> If I shave off the last 10 chars from the name and address fields
> (SUBSTR(ADI_NAME, 1, 50) and SUBSTR(ADI_ADDRES, 1, 50))
> all is ok.
how "long" is your Index ? i think it must be < 250 !
greetings by OHR
Jimmy
| |
| Polihronis Porfiris 2006-01-10, 3:55 am |
| The field lengths are 60 chars for name and address and 8 chars for the date
field (DTOS(dDate) formate YYYYMMDD). So the key length is 60 + 12 = 72
chars. The new lengths are 55 + 12 = 67 chars.
he text length of the expressions surly under 100 chars in length
? "AUGE_OHR" <AUGE_OHR_NOSPAM_@CSI.COM> ?????? ??? ??????
news:dpjqti$fk9$00$1@news.t-online.com...
> hi,
>
>
> how "long" is your Index ? i think it must be < 250 !
>
> greetings by OHR
> Jimmy
>
>
>
| |
| Stephen Quinn 2006-01-10, 3:55 am |
| Polihronis
> If I shave off the last 10 chars from the name and address fields
> (SUBSTR(ADI_NAME, 1, 50) and SUBSTR(ADI_ADDRES, 1, 50)) all is ok.
Glad that worked.
> As for the statements
> SET ORDER TO 0
> DBGOTOP()
>
> I use them to reset the DBF to its natural order so that I can update the
> second meater bar using the current recno being indexed
>
> OPTION ( oMeter2:Set( RecNo() ), SysRefresh(), .T. ) STEP 10
INDEX creation will start at the begining (1st record) of the file anyway (so
recno() works asis), that's why there really is no need to do that and any
previous order has no bearing on the new one being created(unless it's a
sub-index of the existing one<g> ).
HTH
Steve
|
|
|
|
|