Normal variables are destroyed once the function has ended but static variables remain in memory for the life of the program.
local fn DoCounter as long static long sCounter sCounter++ end fn = sCounter long i for i = 1 to 10 NSLog(@"Counter = %ld",fn DoCounter) next HandleEvents
local fn MyFunction static long sVar1, sVar2, sVar3 // ... end fn