Can anyone understand my crash program ?

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by ojahier.

I dont know if these informations (pgm under windows 98) are suficient for help me, but i give them in the case that anyone encontred the same problem, the program contain database instructions (i can post it if necessary) :

-------------------------------------------------
PUREBASIC5496124 a causé une défaillance de page dans
le module PUREBASIC5496124.EXE à 015f:00403242.
Registres :
EAX=00f60078 CS=015f EIP=00403242 EFLGS=00010206
EBX=00000000 SS=0167 ESP=0063fdd0 EBP=0105f108
ECX=0105f248 DS=0167 ESI=8198141c FS=62af
EDX=30303031 ES=0167 EDI=00000005 GS=0000
Octets à CS : EIP :
8a 22 42 8a 01 41 38 c4 75 0d 80 fc 00 75 f1 b8
État de la pile :
00402479 00400000 00000000 81983d04 00000001 00000000 81983d02 0063fe38 00401222 00000001 005102a0 00510060 00408020 00408024 00408028 00000000

Commo estan? Bien ? Me alegro
(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by WolfgangS.

Hi !
Send your Sourcecode ...

MFG
WolfgangS
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by ojahier.
Originally posted by WolfgangS

Hi !
Send your Sourcecode ...

MFG
WolfgangS
The crash with the version of the corresponding version source :
PUREBASIC838088 a causé une défaillance de page dans
le module PUREBASIC838088.EXE à 015f:00403248.
Registres :
EAX=00000102 CS=015f EIP=00403248 EFLGS=00010206
EBX=00000000 SS=0167 ESP=0063fdd0 EBP=0105f118
ECX=0105f248 DS=0167 ESI=8195e268 FS=52cf
EDX=30303031 ES=0167 EDI=00000005 GS=0000
Octets à CS : EIP :
8a 22 42 8a 01 41 38 c4 75 0d 80 fc 00 75 f1 b8
État de la pile :
00402460 00400000 00000000 8195e423 00000001 00000000 8195e421 0063fe38 00401222 00000001 005102a0 00510060 00408020 00408024 00408028 00000000

----------------------------------------------------------------
XIncludeFile "convmontant.pb"
;XIncludeFile "addMontant.pb"

Gosub Inipgm

;Print(FichierEntree.s)

Gosub iniDB
Gosub AnalyseDriver

If ReadFile(0, FichierEntree.s)

While Eof(0) = 0
tt$.s = ReadString()
Gosub alimRub
If compte.s=cpt$
If code_enr.s="01"
Anc_solde.s=Montant.s
Else
If code_enr.s="04"
If cd_AFB.s="01"
Gosub Lect_database
If numchq$=B_emi_num_chq$
;abm.s=Right(convmontant(Montant.s),14)
;abom.s=Mid(resultat.s,2,14)
abom.s=Mid(convmontant(Montant.s),2,14)
Input()
If abom.s=B_emi_montant.s
If b_rej_perime=0
The previous instruction is the instruction where crashing

If cd_BNPP$='0001'
nb1.l=nb1.l+1
; Example 1
b1.s = "1.123456789"
b2.s = "2.111111111"

;sum.s = AddString(b1, b2)
;Debug b1+" + "+b2+" = "+sum

;sk.s=AddString(b1.s,b2.s)
;PrintN(sk.s)
Input()
Else
EndIf
;Else
;Gosub PB_maj
Else
EndIf
Else
EndIf
Else
EndIf



EndIf
EndIf
EndIf

PrintN (code_enr.s)
;PrintN(" ")
;PrintN (compte$)
PrintN(numchq$)
PrintN (convmontant(montant$.s))


EndIf
;EndIf
Wend

CloseFile(0)
Else
MessageRequester("CPAM", "impossible d'ouvrir le fichier", #PB_MessageRequester_Ok)

End
EndIf

;---------------------
;sous programme
;---------------------

alimRub:
compte.s=Mid(tt$.s,22,11)
code_enr.s=Mid(tt$.s,1,2)
date_oper.s=Mid(tt$.s,35,6)
Montant.s=Mid(tt$.s,91,14)
cd_AFB.s=Mid(tt$.s,33,2)
numchq$=Mid(tt$.s,82,7)
cd_BNPP$=Mid(tt$.s,8,4)
Return

Inipgm:
OpenConsole()
ClearConsole()
cd4$="04"
cd1$="01"
cpt$="00016233976"
#Fichier=1
Fichier$ = "0108cpam"
FichierEntree.s = "C:\dgd\Qbasic\" + Fichier$ + ".txt"
nb1.l=0
nb11.l=0
nb2.l=0
nb3.l=0
nb4.l=0
;LCH-let-cpt.s=""
;LCH-let-gui.s="0"
;LCH-div-D.s="0"
;LCH-div-C.s="0"
;LCH-non-let.s="0"
Anc_solde.s=""
Montant.s=""


Return


iniDB :

If InitDatabase() = 0
MessageRequester("Error", "Can't initialize Database (ODBC v3 or better) environment", 0)
End
EndIf

Dim DatabaseType.s(4)
DatabaseType(0) = "Unknown"
DatabaseType(1) = "Numeric"
DatabaseType(2) = "String"
DatabaseType(3) = "Float"

Return

; First, let's see which drivers are attached to the system..
;

AnalyseDriver:

If ExamineDatabaseDrivers()
While NextDatabaseDriver()
PrintN(DatabaseDriverName()+" - "+DatabaseDriverDescription())
Wend
EndIf

Return

Lect_database:

;If OpenDatabaseRequester(0)
If OpenDatabase(0,"bd1.mdb","m907052","xxxx0002")

Command$="select * from extract where B_emi_num_chq="+"'"+numchq$+"'"+";"

If DatabaseQuery(Command$)


While NextDatabaseRow()

B_emi_num_chq$=GetDatabaseString(2)
B_mont.f=GetDatabaseFloat(6)
B_ms_correct.l=GetDatabaseLong(21)
B_rej_perime.l=GetDatabaseLong(57)
B_emi_benef$=GetDatabaseString(5)

B_emi_montant.s=Str(B_mont.f)

B_emi_montant.s = Right("00000000000000"+B_emi_montant.s, 14)

Wend
EndIf

Else
MessageRequester("Info", "Operation canceled", 0)
EndIf

Return

Lettrage_DB:

Command$="update extract set B_emi_emet='L' where B_emi_num_chq="+"'"+numchq$+"'"+";"

Return

PB_maj:
MessageRequester("CPAM", "Pb de maj table : arret TRT", #PB_MessageRequester_Ok)
End

Return


-------------------------------
Commo estan? Bien ? Me alegro!
(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by WolfgangS.

Hi !
this line:
If cd_BNPP$='0001'
change it to
If cd_BNPP$="0001"

It will generate an illegal memory acces error blablabla
Seems like a Bug to me with the '. There should be an errormessage.

MFG
:)WolfgangS

PS: Don't hurt me if i'm wrong ...
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

It was a bug and it's fixed. For v3.40.

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by ojahier.

Thanks a lot for WolfgangS and fred.
Congratulations and best regards.


Ojahier

-------------------------------
Commo estan? Bien ? Me alegro!
(registered PureBasic user)
Post Reply