Menu

GCB not giving error message after compiling

Help
MBB
2023-03-03
2023-03-07
  • MBB

    MBB - 2023-03-03

    I'm using Great Cow BASIC (0.99.01 2022-01-27 (Windows 64 bit) : Build 1073) with an 18F4550.

    When I write a line of code with many "OR" statements such as this:

    If xx = 1 OR xx = 3 OR xx = 5 OR xx = 7 OR xx = 9 OR xx = 11 OR xx = 13 OR xx = 15 OR xx = 17 OR xx = 19 OR xx = 22 OR xx = 24 OR xx = 26 OR xx = 28 OR xx = 30 OR xx = 32 then
    Do something
    End If

    GCB says the program compiled without errors but when I check the time stamps in File Explorer it shows that the .asm, .hex, .html, and .lst files have NOT been updated. The .gcb file is updated.

    If I reduce the number of "OR" statements to 10 then it works correctly.

    Shouldn't GCB give an error message that program did not compile?

     
    • Anobium

      Anobium - 2023-03-03

      Interesting.

      Yes. Is the answer. The compiler should not fail silently.

      Please post a program that has the error. I ask this as I do like have a baseline that is created by the person reporting, and, it ensures I do have a working but failing example.

      Build1073 is very old. It would be best to create the example program using the latest compiler.

      Evan

       
  • MBB

    MBB - 2023-03-03

    See attachment.

     
  • Anobium

    Anobium - 2023-03-03

    Thank you.

    What error do you get with build 1219?


    And, any fix will required build 1219 as the baseline. If that does not work for you then change the IF-THEN to a SELECT-CASE as workaround.


    But, I will fix for others who may hit the same issue in the future.

     

    Last edit: Anobium 2023-03-03
  • MBB

    MBB - 2023-03-03

    No error.

    This is what GCB says when I compile:

    15:58:16 G+Stool started with parameter 'hex' -> processing C:\GCB@Syn8\G+Stools\makeHEX.bat
    Source-File = C:\MARTY\CowBasic\Thermal Camera MLX90640 Adafruit 4407\OR test.gcb
    Target-File = C:\MARTY\CowBasic\Thermal Camera MLX90640 Adafruit 4407\OR test.hex
    Compiler Version: 0.99.01 2022-01-27 (Windows 64 bit) : Build 1073 Program Memory: 400/16384 words (2.44%) RAM: 30/2048 bytes (1.46%) OSC: HSPLL_HS, 48Mhz (Clock source is not a primary internal oscillator. Ensure the clock source is correctly setup) Chip: 18F4550
    Duration: 1.5 Seconds.

     
  • Anobium

    Anobium - 2023-03-04

    Fixed in build 1220. Fix for fatal exit when using complex TypeOfValue()


    Some insights to fix this issue:

    The is the process I used to find the root cause. The root cause needs to found - an obvious statement but a required step.

    -1. Using GCStudio - select the the GCB Compiler from the GCStudio/Setup menu. This will setup GC Code to compile the GCBASIC compiler.
    -2. Open USE.INI - set following to Y

    evbs = y
    verbose = y
    extendedverbosemessages = y
    

    -3. Compile the errant program. This will show the GCB compiler method which is the source of the error. In this case it is that last method to be shown.

    -4. Review GCBASIC.BAS to determine the root cause. In this case the array element being used exceeds array.

    Add code to trap and manage the error. This shows the variable TCC being checked a new constant called TYPECHECKSIZE. TYPECHECKSIZE is the size of the TYPECHECK() array

    If TCC > TYPECHECKSIZE Then
        'fatal error
        LogError "TYPECHECKSIZE exceed - reduce complexity: "+ValueNameIn
        WriteErrorLog
        ErrorsFound = - 1
        end
    End if
    

    -5. Recompile using GC Code, select <f4>, select 'Build GCB Compiler'
    -6. Test to ensure resolution.
    -7. Change release number and date.
    -8. Commit to SVN, or, post to Forum inclusion.
    -9. Revert USE.INI</f4>

    Simple.

     
  • Anobium

    Anobium - 2023-03-04

    To obtain 1220 - install GCStudio, and, you will automatically receive the update.
    If you install GCStudio and what to stay with SynWrite - simply select Legacy Mode.

    I hope this resolves the issue.

     
  • MBB

    MBB - 2023-03-04

    Thanks, I've upgraded to Build 1219.

     
    • Anobium

      Anobium - 2023-03-05

      Whilst waiting for Angel to publish build 1220. You can take the compiler exe's from https://gcbasic.com/reps/goldbuild/masterbuild/GCB@Syn/GreatCowBASIC/

      You will need to select the specific file then select the context menu and use 'save' as'.

      You need to take gcbasic.exe, gcbasic32.exe & gcbasic64.exe. Replace your local exe's and then try your test program again. Please let me this resolves the issue.

       

      Last edit: Anobium 2023-03-05
      • jackjames

        jackjames - 2023-03-06

        Downloading gcbasic64.exe comes out in 42K file.
        If I click it instead: "error 404"

         
        • Anobium

          Anobium - 2023-03-06

          If you restart GCSTUDIO it will update to build 1220 automatically.

           
          • jackjames

            jackjames - 2023-03-07

            Ok. Thanks

             

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.