[fpc-pascal] Is there a way to declare a static varible in a function body?
f26p at eircom.net
Wed Nov 18 11:20:07 CET 2009
On 18/11/2009 08:10, yu ping wrote:
> Is there a way to declare a static varible in a function body?
> the varible should remain the value assigned from last call.
Typed constant, const /name/ : /type/ = /initial value/;
Takes the initial value when the program starts, but you can assign new
values to it. But the value remains constant between calls.
NextValue:Integer = 0;
NextI := NextValue;
NextValue := NextValue+1;
x : Integer;
for x := 1 to 10 do
More information about the fpc-pascal