Author Topic: Fehlermeldung bei DIM  (Read 3539 times)

Offline Worebu

  • Mr. Polyvector
  • ***
  • Posts: 209
  • Seit gemoint liebe Gemeinde
    • View Profile
Fehlermeldung bei DIM
« on: 2021-Aug-29 »
Moin, ich habe wieder eine Fehlermeldung vom Compiler und weiß nicht weiter. Hat jemand eine Idee?

Code: (glbasic) [Select]
GPC - GLBasic Precompiler V.17.312 SN: 04eb7bb - 3D, NET
Wordcount:37 commands
compiling:
F:\Temp\glbasic\gpc_temp0.cpp: In function 'int __GLBASIC__::__MainGameSub_()':
F:\Temp\glbasic\gpc_temp0.cpp:26:18: error: no matching function for call to 'DIM(DGInt&, int, int, int)'
 DIM(uni, 35,35,35);
                  ^
In file included from F:\Temp\glbasic\gpc_temp.h:2:0,
                 from F:\Temp\glbasic\gpc_temp0.cpp:1:
E:\Games\steamapps\common\GLBasic_SDK\Compiler\platform\Include/glb.h:825:25: note: candidate: template<class T> void __GLBASIC__::DIM(__GLBASIC__::DGArray<T>&, DGNat, DGNat, DGNat, DGNat)
 template <class T> void DIM(DGArray<T>& arr, DGNat xt1, DGNat xt2=0, DGNat xt3=0, DGNat xt4=0) {
                         ^
E:\Games\steamapps\common\GLBasic_SDK\Compiler\platform\Include/glb.h:825:25: note:   template argument deduction/substitution failed:
F:\Temp\glbasic\gpc_temp0.cpp:26:18: note:   mismatched types '__GLBASIC__::DGArray<T>' and 'DGInt {aka double}'
 DIM(uni, 35,35,35);
                  ^
In file included from F:\Temp\glbasic\gpc_temp.h:2:0,
                 from F:\Temp\glbasic\gpc_temp0.cpp:1:
E:\Games\steamapps\common\GLBasic_SDK\Compiler\platform\Include/glb.h:942:9: note: candidate: void __GLBASIC__::DIM(__GLBASIC__::DGIntArray&, DGNat, DGNat, DGNat, DGNat)
 void    DIM(DGIntArray& arr, DGNat xt1, DGNat xt2=0, DGNat xt3=0, DGNat xt4=0);
         ^
E:\Games\steamapps\common\GLBasic_SDK\Compiler\platform\Include/glb.h:942:9: note:   no known conversion for argument 1 from 'DGInt {aka double}' to '__GLBASIC__::DGIntArray&'
E:\Games\steamapps\common\GLBasic_SDK\Compiler\platform\Include/glb.h:943:9: note: candidate: void __GLBASIC__::DIM(__GLBASIC__::DGNatArray&, DGNat, DGNat, DGNat, DGNat)
 void    DIM(DGNatArray& arr, DGNat xt1, DGNat xt2=0, DGNat xt3=0, DGNat xt4=0);
         ^
E:\Games\steamapps\common\GLBasic_SDK\Compiler\platform\Include/glb.h:943:9: note:   no known conversion for argument 1 from 'DGInt {aka double}' to '__GLBASIC__::DGNatArray&'
F:\Temp\glbasic\gpc_temp0.cpp: In function 'void __GLBASIC__::Universum()':
F:\Temp\glbasic\gpc_temp0.cpp:100:10: error: '__GLBASIC__::uni' cannot be used as a function
 uni(x,y,z) = RND(400);
          ^
*** FATAL ERROR - Bitte die Compiler-Ausgabe ins Forum kopieren
_______________________________________
*** Fertig ***
Dauer: 1.3 sek. Zeit: 10:29
Erstellen: 5 erfolgreich.
*** 16 FEHLGESCHLAGEN ***


Vielen Dank im voraus.
« Last Edit: 2021-Aug-29 by Worebu »
Intel I5 9600 - RTX 2080 Super, WaKü, 32GB RAM, 1x 512gb + 1x 1Gb NVRAM,  1x4TB + 1x1TB HD

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2795
    • View Profile
Re: Fehlermeldung bei DIM
« Reply #1 on: 2021-Aug-30 »
Can you post some code that produces the error Worebu?
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 Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5116
  • O Rly?
    • View Profile
Re: Fehlermeldung bei DIM
« Reply #2 on: 2021-Sep-17 »
Hast du Dim falsch verwendet?

Code: (glbasic) [Select]
DIM uni[35][35][35]
http://www.glbasic.com/xmlhelp.php?lang=de&id=16&action=view
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Worebu

  • Mr. Polyvector
  • ***
  • Posts: 209
  • Seit gemoint liebe Gemeinde
    • View Profile
Re: Fehlermeldung bei DIM
« Reply #3 on: 2021-Sep-17 »
Hi, sorry für die späte Meldung.

Ich mache es genauso wie beschrieben,
wenn ich unter den  Optionen "Explizite Deklaration" ausschalte, ist alles gut. Wie deklariere ich den ein solch ein Feld?

Danke.

« Last Edit: 2021-Sep-18 by Worebu »
Intel I5 9600 - RTX 2080 Super, WaKü, 32GB RAM, 1x 512gb + 1x 1Gb NVRAM,  1x4TB + 1x1TB HD

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5116
  • O Rly?
    • View Profile
Re: Fehlermeldung bei DIM
« Reply #4 on: 2021-Sep-20 »
LOCAL oder GLOBAL
Code: (glbasic) [Select]
LOCAL uni[]
REDIM uni[35][35][35]

So sollte es gehen.
« Last Edit: 2021-Sep-20 by Schranz0r »
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10859
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Fehlermeldung bei DIM
« Reply #5 on: 2021-Sep-27 »
uni wurde als Integer erkannt, nicht als array. Schreib LOCAL uni[] davor.

Offline Worebu

  • Mr. Polyvector
  • ***
  • Posts: 209
  • Seit gemoint liebe Gemeinde
    • View Profile
Re: Fehlermeldung bei DIM
« Reply #6 on: 2021-Oct-01 »
ah, ok.Danke
Intel I5 9600 - RTX 2080 Super, WaKü, 32GB RAM, 1x 512gb + 1x 1Gb NVRAM,  1x4TB + 1x1TB HD