Fehler?

Previous topic - Next topic

S. P. Gardebiter

Hi, hab heute ne Fehlermeldung gekriegt:

Code (glbasic) Select
compiling:
G:\DOKUME~1\SPFD42~1.GAR\LOKALE~1\Temp\glbasic\gpc_temp0.cpp: In function `DGInt __GLBASIC__::Draw_Stage()':
G:\DOKUME~1\SPFD42~1.GAR\LOKALE~1\Temp\glbasic\gpc_temp0.cpp:113: error: no match for 'operator=' in '__GLBASIC__::sfxx = __GLBASIC__::RND(6.4e+2)'
D:/Project/Languages/GLBasic/Compiler/platform/Include/glb.h:275: note: candidates are: __GLBASIC__::DGIntArray& __GLBASIC__::DGIntArray::operator=(const __GLBASIC__::DGIntArray&)
*** FATAL ERROR - Bitte die Compiler-Ausgabe ins Forum kopieren
Durch diesen Code:

Code (glbasic) Select
IF Stage = 1
IF StageInit = TRUE
FOR count = 0 TO 63
IF sfxon[count] = 1
IF sfxy[count] >= 496
sfxon[count] = 0
ENDIF
IF sfxtype[count] = 2
INC sfxy[count], 1
ENDIF
IF sfxtype[count] = 1
INC sfxy[count], 2
ENDIF
IF sfxtype[count] = 0
INC sfxy[count], 3
ENDIF
DRAWANIM 2, sfxtype[count], sfxx[count], sfxy[count]
ELSE
sfxx = RND(640)
sfxy[count] = -16
sfxon[count] = 1
IF count <= 9
sfxtype[count] = 0
ENDIF
IF count <= 24
sfxtype[count] = 1
ENDIF
IF count >= 25
sfxtype[count] = 2
ENDIF
DRAWANIM 2, sfxtype[count], sfxx[count], sfxy[count]
ENDIF
NEXT
ELSE
FOR count = 0 TO 63
sfxx[count] = RND(640)
sfxy[count] = RND(480)
sfxon[count] = 1
IF count <= 9
sfxtype[count] = 0
ENDIF
IF count <= 24
sfxtype[count] = 1
ENDIF
IF count >= 25
sfxtype[count] = 2
ENDIF
DRAWANIM 2, sfxtype[count], sfxx[count], sfxy[count]
StageInit = TRUE
NEXT
ENDIF
ENDIF

RETURN

ENDSUB
Wahrscheinlich war ich nur malwieder zu doof :)
Ich hoffe ihr könnt mir helfen.
~ Cave Story rules! ~

Tiuz

Hallo S.P. Gardebiter,

in deinem Code wird die Variable 'sfxx' mal als Scalar, mal als Feld angesprochen:

Code (glbasic) Select
[...]
sfxx = RND(640)
[...]
sfxx[count] = RND(640)
Glaube das verursacht den Compilerfehler.

Grüße, Tiuz.

Schranz0r

denke ich auch mal ;)
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

Danke :P
~ Cave Story rules! ~