yes, tron and manning, you guys are right. i just added var and it RUNS! but is there a way other than using var?
: It definitely is the problem. I just downloaded your code to test it, and that's when I noticed that you are compiling a windows target, which (in BP at least) has a default stack size of 8k.
:
: As was pointed out, your array is 10k, and if you dont use var, then it has to create the local variable instead of use the global variable, and of course putting a 10k variable on an 8k stack just isnt going to work.
:
: So either tweak the stack size, or use var. Either way will work.
:
:
: : o, maybe that's the problem. i'll have to try that. thz
: :
: : : I see you have changed your code, so that your "linear" procedure is using "no" now. Well, "somehow" I knew that something was wrong with ...

: : :
: : : But you still can get a StackOverflow because you are not using the "var" indicator. The "var" doesn't simply mean that changes to the array will be visible outside the procedure - in this case, what is much more important:
using "var" prevents from copying the whole array onto the stack when calling "linear". Your array has 5000 entries and an integer is (usualy, at least in TP) 2Bytes - so that the array has 10,000 Bytes. This might be too much for your stack configuration.
: : :
: : : Whenever you pass a big array into a procedure/function, you should think about using the "var" indicator.
: : :
: : : tron.
: : :
: : : : but i'm trying to find a specific number in the array though, i don't need to change the array, that's y i didn't use "var". i tried bracketing half of the procedure out to make sure memory wouldn't be a problem, but it didn't work. i even tried changing the "no" to "num" and procedure name. i really don't know what's wrong!
: : :
: :
: :
:
: