[Implemented] STATIC with initial value

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
benny
Enthusiast
Enthusiast
Posts: 465
Joined: Fri Apr 25, 2003 7:44 pm
Location: end of www
Contact:

[Implemented] STATIC with initial value

Post by benny »

Hi ho ...
shame on me. You work so hard for the update, and me the greedy user demands more and more features :twisted: sorry.

But would it be possible, to pass e.g. to a STATIC variable something like an initial value. ATM every declared variable is 0.

Lets say, that this would be possible :

Code: Select all

STATIC a.l = 10
(maybe also for GLOBAL, PROTECTED and SHARED).

This would make the following easier

Code: Select all

 and the DEBUG-Result would be 11 and 12 ! ...
[code]
Procedure Test()
  Static a.l = 10
  a.l + 1
  ProcedureReturn a.l
EndProcedure

Debug Test()
Debug Test()
regards,
benny!
-
pe0ple ar3 str4nge!!!