GLBasic forum

Other languages => GLBasic - de => Topic started by: S. P. Gardebiter on 2008-Apr-01

Title: Fehler?
Post by: S. P. Gardebiter on 2008-Apr-01
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.
Title: Fehler?
Post by: Tiuz on 2008-Apr-01
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.
Title: Fehler?
Post by: Schranz0r on 2008-Apr-01
denke ich auch mal ;)
Title: Fehler?
Post by: S. P. Gardebiter on 2008-Apr-01
Danke :P