Author Topic: Fatal Error - Please Post This in the Forum  (Read 1501 times)

Offline Widget101

  • Mc. Print
  • *
  • Posts: 9
    • View Profile
Hi there,

I've just encountered an error in my program which, when compiled is bringing up the following:
Code: GLBasic [Select]
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.10.037 SN:13d366d5 - 3D, NET
Wordcount:943 commands
compiling:
C:\Users\User\AppData\Local\Temp\glbasic\gpc_temp0.cpp: In function `int __GLBASIC__::__MainGameSub_()':
C:\Users\User\AppData\Local\Temp\glbasic\gpc_temp0.cpp:570: error: no matching function for call to `DIM(__GLBASIC__::DGStr&, int)'
D:/GLBasic/Compiler/platform/Include/glb.h:916: note: candidates are: void __GLBASIC__::DIM(__GLBASIC__::DGIntArray&, DGNat, DGNat, DGNat, DGNat)
D:/GLBasic/Compiler/platform/Include/glb.h:917: note:                 void __GLBASIC__::DIM(__GLBASIC__::DGNatArray&, DGNat, DGNat, DGNat, DGNat)
C:\Users\User\AppData\Local\Temp\glbasic\gpc_temp0.cpp: In function `DGInt __GLBASIC__::bumptext(__GLBASIC__::DGStr)':
C:\Users\User\AppData\Local\Temp\glbasic\gpc_temp0.cpp:4114: error: no match for call to `(__GLBASIC__::DGStr) (DGInt)'
C:\Users\User\AppData\Local\Temp\glbasic\gpc_temp0.cpp:4114: error: no match for call to `(__GLBASIC__::DGStr) (DGInt&)'
C:\Users\User\AppData\Local\Temp\glbasic\gpc_temp0.cpp:4124: error: no match for call to `(__GLBASIC__::DGStr) (int)'
C:\Users\User\AppData\Local\Temp\glbasic\gpc_temp0.cpp: In function `DGInt __GLBASIC__::textline()':
C:\Users\User\AppData\Local\Temp\glbasic\gpc_temp0.cpp:4161: error: no match for call to `(__GLBASIC__::DGStr) (DGInt&)'
*** FATAL ERROR - Please post this output in the forum
 
I'd set up a couple of functions (Bumptext and Textline) which receives a text string and adds it to a list which them moves it up the list as a new text string is received.

Bumptext moves the text string up the list and Textline just prints the 8 text lines to the screen each refresh:

Code: GLBasic [Select]
FUNCTION bumptext: text$
        FOR f=6 TO 0 STEP -1
                displaytext$[f+1]=displaytext$[f]
        NEXT
        displaytext$[0]=text$
ENDFUNCTION

FUNCTION textline:
        FOR f=0 TO 7
                PRINT displaytext$[f],20,(20+f*20)
        NEXT
ENDFUNCTION
 

Since getting the error I've tried remming out and removing the changes I made to the code, ignoring the commands and the functions that call them but its still crashing on every run which I'm struggling to understand as every change I've made should be ignored or undone.

Any help would be appreciated :)
« Last Edit: 2016-Jan-26 by Widget101 »

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2613
    • View Profile
Re: Fatal Error - Please Post This in the Forum
« Reply #1 on: 2016-Jan-26 »
Look for a line near the start that start with "DIM displaytext$[8]", well that is how it should look anyway, for the error.

Also, try taking out the "$"(e.g. displaytext[f+1]) while referencing the array.
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

Offline Widget101

  • Mc. Print
  • *
  • Posts: 9
    • View Profile
Re: Fatal Error - Please Post This in the Forum
« Reply #2 on: 2016-Jan-26 »
Thanks Ian,

That did it!

I had:

GLOBAL displaytext$
DIM displaytext$[10]

I'd missed the brackets off the global displaytext$[]

Many thanks. :)

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2613
    • View Profile
Re: Fatal Error - Please Post This in the Forum
« Reply #3 on: 2016-Jan-26 »
 ;)
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)