No announcement yet.

Strange error 3

  • Filter
  • Time
  • Show
Clear All
new posts

  • Strange error 3

    I have been having some problems with a control program I have been
    writing. Running on my laptop (486dx2 66, dos 6.22, win 3.1, 8Mb ram)
    I have no trouble running either from an exe or from inside powerbasic.
    When I copy the exact same exe file to the desktop PC (pentium 200ish,
    98se, 32Mb ram) I continually get an error.
    From the error message it says that there is a return without gosub
    error in line 22008. As it is impossible to get to line 22008 without
    a gosub it has me quite puzzled. This line is part of a loop that displays
    the current time and date every 0.45s.
    I have quite a bit of information shoved into arrays and was wondering
    if this could possibly be affecting the stack???
    I can email a copy of the source code if anyone is interested in
    having a look (its not real tidy).


  • #2
    It sounds like a memory corruption issue - the cause could in a seemingly unrelated section of your code that writes past an array boundary, bad inline assembler, incorrect use of pointers, a memory manager problem or something similar.

    The 1st thing to do is add $ERROR ALL ON to the code and run it again... this enables alll runtime error testing (which is OFF by default).

    One more idea: be sure there are no out-of-scope GOSUBS's or GOTO's - ie, a GOSUB or GOTO into the middle of another Sub/Function... this can cause all sorts of problems because the stack frame will not be initialized for that Sub/Function.

    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    mailto:[email protected]