Announcement

Collapse
No announcement yet.

CODE STOPS IN ".EXE" FILE?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CODE STOPS IN ".EXE" FILE?

    I just copied a PB3.5 PROGRAM FROM WINDOWS 98 TO MY OLD IBM
    WINDOWS 3.1 AND RECOMPILED. It will run fine in the "IDE",
    but when I type the ".exe" at the command prompt, it freezes
    up in one of the subfunction? How can this happen, run ok in
    the "ide" and not the "exe" file?
    Someone please help

    Thanks,
    Brent

    ------------------

  • #2
    There is not much info to go on there Brent. What is the sub/function doing that causes the crash? Do you actually know which sub/function it is, or are you guessing based on the text display, or something else altogether?

    The first step in debugging is to enable error trapping by adding $ERROR ALL ON to the code, recompile, then try the app on the other machine again.


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

    Comment


    • #3
      Lance,

      I ran my program in old computer with "$ERROR ALL", but did
      not show any different results. I finally figured out that
      I was running program in IDE with the compile destination set
      to memory. When I changed destination to ".EXE" and tried to
      compile, I get free memory space: 2656k time: 00:06 - at bottom
      PRESS CTRL-BREAK TO QUIT. O.K., when I press Ctrl-Break, nothing
      happens and I have to simply turn off computer. I checked to
      see if I had ctrl-break turned "on" in options>linker and it was?
      Well, after numerious tries, I finally noticed in the "dos" dir
      that my ".exe" file size had increased, so I typed the .exe file
      name in at the prompt and it worked fine. Why does the compile
      not show success? Why does it stop after both phases have
      completed?

      Thanks for your help,
      Brent

      ------------------

      Comment


      • #4
        Hi Brent,

        Unfortunately I can offer no serious suggestions since I'm not able to see or duplicate the problem, and have almost no information from you surrounding the precise circumstances, machine and OS details, OS configuration, build version of compiler, etc.

        For example, it could be that your OS was unstable and needed rebooting, a file is corrupted, your memory manager is bad, your PC is faulty, there is a TSR that is interfering, or gamma radiation is strong in your locale right now. Or it could be a bug in the compiler. I have no way to tell given the small amount of information provided above.

        However, if you'd like to ZIP the entire code you are using and email it to tech support, along with all the information mentioned above (plus the contents of your AUTOEXEC.BAT and CONFIG.SYS [or equivalent files if you are using NT/2000/XP/etc]), statistics of free memory and memory organization, TSR list, plus the time/date stamp of your compiler (PB.EXE), I'll take a look for you...

        Thanks!

        PS: your Reply-notification messages are bouncing... please update your Forum Profile with a valid email address. Thanks!


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

        Comment


        • #5
          I finally got my PB 3.5 program to compile in my old IBM COMPUTER.
          The program LINKS a unit full of sub routines. Three of the sub
          routines had PUBLIC declared on top line of Sub and paarameters.
          Well, one of parameters or shared variables matched a var. I used
          to keep the count of records in a random access file in my main
          program. So, I changed the variable name and the .exe file
          changed from 193,000 to 184,000 and compiled properly. It seems
          anything over 185,000 bytes in .exe file is too much to compile.

          ------------------

          Comment


          • #6
            I've created dozens of PBU and EXE files that are WAY larger than that (one .PBU is 259Kb and PBU's do not include any RTL code!) , so unfortunately your conclusion cannot be correct.

            The problem with code compiling fine on one PC and not on another is symptomatic of a memory manager problem on the problem PC.

            If CONFIG.SYS is using HIMEM.SYS (and EMM386.EXE) that are located in the \DOS folder, then change it so that it uses the versions installed in the \WINDOWS folder (or vice versa!).

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

            Comment


            • #7
              Lance,

              Sorry, my program had same problem on [aptiva] windows 98 and
              ibm pc[windows 3.1]. The Config file are different on each computer.
              win98 ex: DEVICE=C:\WINDOWS\HIMEM.SYS/TESTMEM OFF
              FILES=100
              BUFFER=100
              DOS=HIGH.UMB
              SHELL = C:\COMMAND.COM C:\/P /E:512
              WIN3.1 EX EVICE=C:\DOS\SETVER.EXE
              DEVICE=C:\WINDOWS\HIMEM.SYS
              DOS=HIGH
              FILES=30
              SHELL C:\DOS\COMMAND.COM C:\DOS /P /E:512
              DEVICE C:\WINDOWS\SMARTDRV.EXE /DOUBLE_BUFFER
              STACKS 9256
              Do I need to change anything?

              Thanks,

              Brent

              ------------------

              Comment


              • #8
                First, for the Win3.1 machine, I'd change the HIMEM.SYS path to use the newer version installed in the DOS folder, thus:
                Code:
                DEVICE=C:\DOS\HIMEM.SYS
                Also, I'd get rid of the SETVER line and the STACKS lines, as they appear redundant.

                Finally, the DOS line should have a comma, rather than a period.

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

                Comment

                Working...
                X