Entry
Bbcbasic: Variable: Initialize: Can you declare the value of a variable when you initialize it?
Feb 2nd, 2006 17:38
Knud van Eeden,
----------------------------------------------------------------------
--- Knud van Eeden --- 05 Juny 2005 - 02:59 pm -----------------------
Bbcbasic: Variable: Initialize: Can you declare the value of a
variable when you initialize it?
---
No.
---
What does happen is when you use LOCAL then
that variable is initialized by default to
zero or the empty string.
You have thus to set that variable after you used
LOCAL.
===
e.g.
This will give a syntax error:
('not in a function')
--- cut here: begin --------------------------------------------------
PROCt
END
:
:
:
DEF PROCt
LOCAL myinteger1 = 10
END
--- cut here: end ----------------------------------------------------
---
e.g.
This will not give a syntax error:
--- cut here: begin --------------------------------------------------
PROCt
END
:
:
:
DEF PROCt
LOCAL myinteger1
myinteger1 = 10
END
--- cut here: end ----------------------------------------------------
===
Internet: see also:
---
----------------------------------------------------------------------