Probleme mit READ und Arrays

Previous topic - Next topic

S. P. Gardebiter

Hallo, ich habe ein Problem, der Compiler gibt mir folgenden Fehler:

Code (glbasic) Select
G:\DOKUME~1\SPFD42~1.GAR\LOKALE~1\Temp\glbasic\gpc_temp0.cpp: In function `DGInt __GLBASIC__::Edit()':
G:\DOKUME~1\SPFD42~1.GAR\LOKALE~1\Temp\glbasic\gpc_temp0.cpp:409: error: invalid initialization of reference of type 'DGNat&' from expression of type 'double'
D:/Project/Languages/GLBasic/Compiler/platform/Include/glb.h:829: error: in passing argument 2 of `void __GLBASIC__::READUWORD(DGNat, DGNat&)'
G:\DOKUME~1\SPFD42~1.GAR\LOKALE~1\Temp\glbasic\gpc_temp0.cpp:413: error: invalid initialization of reference of type 'DGNat&' from expression of type 'double'
D:/Project/Languages/GLBasic/Compiler/platform/Include/glb.h:829: error: in passing argument 2 of `void __GLBASIC__::READUWORD(DGNat, DGNat&)'
G:\DOKUME~1\SPFD42~1.GAR\LOKALE~1\Temp\glbasic\gpc_temp0.cpp:414: error: invalid initialization of reference of type 'DGNat&' from expression of type 'double'
D:/Project/Languages/GLBasic/Compiler/platform/Include/glb.h:829: error: in passing argument 2 of `void __GLBASIC__::READUWORD(DGNat, DGNat&)'
G:\DOKUME~1\SPFD42~1.GAR\LOKALE~1\Temp\glbasic\gpc_temp0.cpp:415: error: invalid initialization of reference of type 'DGNat&' from expression of type 'double'
D:/Project/Languages/GLBasic/Compiler/platform/Include/glb.h:829: error: in passing argument 2 of `void __GLBASIC__::READUWORD(DGNat, DGNat&)'
G:\DOKUME~1\SPFD42~1.GAR\LOKALE~1\Temp\glbasic\gpc_temp0.cpp:416: error: invalid initialization of reference of type 'DGNat&' from expression of type 'double'
D:/Project/Languages/GLBasic/Compiler/platform/Include/glb.h:829: error: in passing argument 2 of `void __GLBASIC__::READUWORD(DGNat, DGNat&)'
G:\DOKUME~1\SPFD42~1.GAR\LOKALE~1\Temp\glbasic\gpc_temp0.cpp:417: error: invalid initialization of reference of type 'DGNat&' from expression of type 'double'
D:/Project/Languages/GLBasic/Compiler/platform/Include/glb.h:829: error: in passing argument 2 of `void __GLBASIC__::READUWORD(DGNat, DGNat&)'
*** FATAL ERROR - Bitte die Compiler-Ausgabe ins Forum kopieren


Code ist hier: http://spgardebiter.sp.funpic.de//Test//Pattern%20Editor.zip
~ Cave Story rules! ~

Schranz0r

Bei Read musst du aufpassen!

Ob da ein % oder # ist!


Also da READWORD ein Integer fordert musst du es so machen:

Code (glbasic) Select
DIM PatternPara%[PatternSize][11 + EBulletParaSize]
DIM PatternParaMax%[11 + EBulletParaSize]
DIM PatternPlusMinus%[PatternSize][11 + EBulletParaSize]
DIM PatternSign%[PatternSize][11 + EBulletParaSize]
DIM PatternMul%[PatternSize][11 + EBulletParaSize]
DIM PatternMax%[PatternSize][11 + EBulletParaSize]
DIM PatternTick%[PatternSize][11 + EBulletParaSize]
DIM PatternUsed%[PatternSize]
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

S. P. Gardebiter

Quote from: Schranz0r on 2009-Jan-02
Bei Read musst du aufpassen!

Ob da ein % oder # ist!


Also da READWORD ein Integer fordert musst du es so machen:

Code (glbasic) Select
DIM PatternPara%[PatternSize][11 + EBulletParaSize]
DIM PatternParaMax%[11 + EBulletParaSize]
DIM PatternPlusMinus%[PatternSize][11 + EBulletParaSize]
DIM PatternSign%[PatternSize][11 + EBulletParaSize]
DIM PatternMul%[PatternSize][11 + EBulletParaSize]
DIM PatternMax%[PatternSize][11 + EBulletParaSize]
DIM PatternTick%[PatternSize][11 + EBulletParaSize]
DIM PatternUsed%[PatternSize]


Vielen Dank Schranzor :D
~ Cave Story rules! ~

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