"Constants must be initialized" HELP PLZZZ

Blitz3D Forums/Blitz3D Beginners Area/"Constants must be initialized" HELP PLZZZ

NerdyBrendan(Posted 2010) [#1]
What on Earth does this mean..... and how do I fix it????


Matty(Posted 2010) [#2]
If you post some code then we should be able to help you.


Midimaster(Posted 2010) [#3]
You have to give the constant a value already in the moment when you define it:

wrong:
Const A
Const B
A=9
B="Tarzan"


right:
Const A=9
Const B="Tarzan"



_PJ_(Posted 2010) [#4]
As Midimaster says.

'standard' variables that may change, such as Local or Global variables do not need to be given a definite value at the outset, since this can be flled in later:

Global A_Global_Var
Local AnotherLocalVar

Print Str(A_Global_Var)
Print A_Local_Var$
Print Str(AnotherLocalVar#)

A_Global_Var=3
A_Local_Var="Hi!"
Local AnotherLocalVar=0.6

Print Str(A_Global_Var)
Print A_Local_Var$
Print Str(AnotherLocalVar#)


However, since Constants are special in that they will NEVER EVER change throughhout your entire program, Blitz needs to know what they are right from the moment they are first defined.

Const This_Wont_Work
This_Wont_Work=3
Const But_This_Will=3