Author Topic: Qb64 program Crashes  (Read 317 times)

emery

  • Hero Member
  • *****
  • Posts: 570
    • Dhpos Self Checkout module
Qb64 program Crashes
« on: October 25, 2011, 07:44:02 PM »
Code: [Select]
[url]http://dhpos.site40.net/p.b[/url]
My code is there ^^

I have narrowed it down to that section of code, it makes my program crash
i cannot release the rest of the code as it is a private, secure software code

Checkout my free selfcheckout module for dhpos at http://dhpos.midislandsnoblazers.ca/index.php

SkyCharger001

  • Hero Member
  • *****
  • Posts: 1609
Re: Qb64 program Crashes
« Reply #1 on: October 25, 2011, 11:58:13 PM »
you broke your link by putting it in a codebox.

Clippy

  • Hero Member
  • *****
  • Posts: 16446
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: Qb64 program Crashes
« Reply #2 on: October 26, 2011, 12:14:23 AM »
No code, no help. There is a reason some people keep their code to themselves. The reason is that they fixed all of the error by themselves...
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

Galleon

  • Administrator
  • Hero Member
  • *****
  • Posts: 4711
  • QB Forever
    • Email
Re: Qb64 program Crashes
« Reply #3 on: October 26, 2011, 02:04:46 AM »
I cannot see anything here that in and of itself would cause a crash. Check for division by 0 or recursive calls to the same SUB/FUNCTION.
Code: [Select]
PRINT "LOOP DONE"
CLOSE #3
IF good = 1 THEN
    C$ = "PASSWORD"
    D$ = "OK!"
    CALL POLE(C$, D$, E#, U, N, NET, taxx, GR, UP$)
    SLEEP 1
END IF
PRINT "GOOd"
IF good = 0 THEN
    C$ = "PASSWORD"
    D$ = "BAD"
    CALL POLE(C$, D$, E#, U, N, NET, taxx, GR, UP$)
    SLEEP 1
END IF
Something old... Something new... Something borrowed... Something blue...

SkyCharger001

  • Hero Member
  • *****
  • Posts: 1609
Re: Qb64 program Crashes
« Reply #4 on: October 26, 2011, 02:32:12 AM »
A. I think you have a bug in POLE
B. the two IFs should be replaced with SELECT CASE, as it is there's a change of both being run... (Is the passwork OK or BAD?... make-up your mind! :-\)

Clippy

  • Hero Member
  • *****
  • Posts: 16446
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: Qb64 program Crashes
« Reply #5 on: October 26, 2011, 08:47:36 AM »
OH, I thought he was using that link in a file downloader...my bad...SELECT CASE ???

Code: [Select]
PRINT "LOOP DONE"
CLOSE #3
C$ = "PASSWORD"
IF good = 1 THEN  D$ = "OK!" ELSE IF good = 0 THEN D$ = "Bad"
CALL POLE(C$, D$, E#, U, N, NET, taxx, GR, UP$)
SLEEP 1
« Last Edit: October 26, 2011, 10:27:00 AM by Clippy »
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

emery

  • Hero Member
  • *****
  • Posts: 570
    • Dhpos Self Checkout module
Re: Qb64 program Crashes
« Reply #6 on: October 26, 2011, 04:07:25 PM »
PRINT "GOOd"
is there because that is for me to narrow down where it crashes
CALL POLE works fine

but that is where it crashes :(
Checkout my free selfcheckout module for dhpos at http://dhpos.midislandsnoblazers.ca/index.php

Clippy

  • Hero Member
  • *****
  • Posts: 16446
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: Qb64 program Crashes
« Reply #7 on: October 26, 2011, 04:22:48 PM »
Well if good = 1 then the second IF is skipped. Does it print good?  There is nothing else that could crash it but the SUB.
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

emery

  • Hero Member
  • *****
  • Posts: 570
    • Dhpos Self Checkout module
Re: Qb64 program Crashes
« Reply #8 on: October 26, 2011, 05:57:30 PM »
Good = 0
It prints nothing
Checkout my free selfcheckout module for dhpos at http://dhpos.midislandsnoblazers.ca/index.php

emery

  • Hero Member
  • *****
  • Posts: 570
    • Dhpos Self Checkout module
Re: Qb64 program Crashes
« Reply #9 on: October 26, 2011, 09:24:45 PM »
hmm, so i found out that it doesn't crash there, it crashes on some IF good = 1 THEN IF ... lines below  :(
Checkout my free selfcheckout module for dhpos at http://dhpos.midislandsnoblazers.ca/index.php

SkyCharger001

  • Hero Member
  • *****
  • Posts: 1609
Re: Qb64 program Crashes
« Reply #10 on: October 27, 2011, 04:44:11 AM »
When using nested IFs you may want to do each of them as it's own block.
that way you have a better change of determining which is the culprit.

emery

  • Hero Member
  • *****
  • Posts: 570
    • Dhpos Self Checkout module
Re: Qb64 program Crashes
« Reply #11 on: November 01, 2011, 10:17:57 PM »
ok, i have fixed it now ;D
Checkout my free selfcheckout module for dhpos at http://dhpos.midislandsnoblazers.ca/index.php