Qbasicnews.com
January 16, 2021, 02:20:20 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Back to Qbasicnews.com
|
QB Online Help
|
FAQ
|
Chat
|
All Basic Code
|
QB Knowledge Base
Home
Help
Search
Login
Register
Qbasicnews.com
>
Qbasic "like" compilers/interpreters
>
FB Discussion & Programming Help
>
Why does using STATIC give me an error?
Pages: [
1
]
« previous
next »
Print
Author
Topic: Why does using STATIC give me an error? (Read 3336 times)
BiLLaMoNsTeR
New Member
Posts: 7
Why does using STATIC give me an error?
«
on:
February 04, 2005, 12:44:01 AM »
This works in QBASIC, but not in FreeBASIC for some reason.
It says duplicated definition for "dim array(47) as integer".
Code:
sub subname ()
static array() as integer, notfirst
if notFirst = 0 then
notFirst = 1
dim array(47) as integer
end if
end sub
Am I doing something wrong?
EDIT: Whoops, I just figured out that doing "STATIC array(47)" to dimension the variable works.
Logged
relsoft
*/-\*
Posts: 3927
Why does using STATIC give me an error?
«
Reply #1 on:
February 04, 2005, 02:47:05 AM »
redim?
Logged
y smiley is 24 bit.
Genso's Junkyard:
http://rel.betterwebber.com/
barok
Na_th_an
Posts: 1727
How about a tasty lead sandwich?
Why does using STATIC give me an error?
«
Reply #2 on:
February 04, 2005, 02:51:56 AM »
maybe array's a keyword or something? I dunno... I recall something about how you have to have '$dynamic (or just DYNAMIC now) or something'll happen to variables.
I got nothing. :lol:
Logged
Jumping Jahoolipers!
v3cz0r
I hold this place together
Posts: 924
Why does using STATIC give me an error?
«
Reply #3 on:
February 05, 2005, 06:42:03 PM »
STATIC syntax is FB is the same as with DIM or REDIM, not like in QB where you have to declare the array twice, simple do:
static somearray(lowerbound to upperbound, ...) as sometype
lowerbound and upperbound can't be variables, only constant expressions.
Logged
ew FreeBASIC forums:
http://www.freebasic.net/forum/index.php
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Forum has moved
-----------------------------
=> Forum has moved
-----------------------------
QbasicNews.Com
-----------------------------
=> QB/FB News
=> Site/Forum Issues
=> Challenges
-----------------------------
QBasic
-----------------------------
=> QB Discussion & Programming Help
=> QB Projects
-----------------------------
Qbasic "like" compilers/interpreters
-----------------------------
=> General QB "like"
=> QB64
=> FB Discussion & Programming Help
===> FB Projects
===> FB Documentation
-----------------------------
General
-----------------------------
=> General/Misc
===> Art & Music
===> General Programming
Loading...