English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

How can i declare a variable inside the function, so that i can update it example:
function
{
dim counter as integer
integer++
}
i mean something like this so everytime that i call the function it adds 1 to the integer
(@@$$** i dont want to use a global variable **$$@@)

2006-09-28 02:43:53 · 2 answers · asked by aryaxt 3 in Computers & Internet Programming & Design

my bad it should be counter++ i know
but im njot allowed to use any global variable :(

2006-09-28 03:11:34 · update #1

2 answers

Declare is outside the function and then pass the variable to the function. This way "counter" won't be reset each time the function executes.

2006-09-28 02:46:26 · answer #1 · answered by IT Pro 6 · 0 0

Your increment should be

counter++

2006-09-28 09:59:26 · answer #2 · answered by AnalProgrammer 7 · 0 0

fedest.com, questions and answers