Programming Help

Hi all,

I have been looking all over the web for this solution but can not find any:

I need to ask the user to enter in a numeric value and then search the number of time it appears in the list of values and then ask the user to enter a value again to see if it is in the list and report its position etc.

How would I do all of this, please help me.

Thanks

Comments

searching a list

Hi,

First of all you must put your list of numbers into an array - lets call it numbers() where total is how many numbers there are in the list
LET total=ubound(numbers)

Next you need to get some input from the user - lets call it target.

Now you need to test the target against all numers in the list e.g.
LET hits=0
FOR n=1 to total
IF numbers(n)=target then
LET hits=hits+1
PRINT n ! this is the position of the number in the list
END IF
NEXT n

Not so difficult alfer all.

Regards
Big John