Nope, the command is quite valid, and increments by 1.
The problem is that he doesn't yet have an understanding of what labelling a variable 'global' does in DBPro.
All DBPro parameters are passed by value, so changing them only changes the temporary copy - even if the variable that you are passing is global.
If you want to increment a global, then you should just increment it using its global name
Your first piece of code
sync rate 60
sync on
global test
do
set cursor 0,0
print test
add_test()
sync
loop
function add_test()
inc test
endfunction
Arrays defined outside of a function are automaticall global, and you can't pass an array to a function ...
Your second piece of code
sync rate 60
sync on
dim test(2)
test(2) = 100
do
set cursor 0,0
print test
add_test()
sync
loop
function add_test()
test(1) = test(1)+1
test(2) = test(2)+1
endfunction
[EDIT]Oops, too late. You can 'sort of' pass an array by reference, but you would need to use my array plug-in ... plus it's a bit temperamental and easy to crash[/EDIT]