Problem writing a program
Hills
Posts: 13
Hi
I have a problem writing a program with Basic Stamp Editor Software.
I need a program who can search the smallest number in a group·of numbers or expressions. For example: the·smallest number in this array is p(2)=5
p·· var··Nib
p(0)=15
·p(1)=10·
············ p(2)=5·············
Could you guys please help me·by solving my problem and by giving me the program·in the BASIC STAMP FORUM·or·in my email:
····· pjosehills@hotmail.com
Remember that if it's impossible to search the smallest number·or expession·in an array, I would be very happy with a program who can search the smalest number or expression·in a group of numbers. For example :·with the command LOOKDOWN.
Post Edited (Hills) : 11/23/2004 11:13:21 PM GMT
I have a problem writing a program with Basic Stamp Editor Software.
I need a program who can search the smallest number in a group·of numbers or expressions. For example: the·smallest number in this array is p(2)=5
p·· var··Nib
p(0)=15
·p(1)=10·
············ p(2)=5·············
Could you guys please help me·by solving my problem and by giving me the program·in the BASIC STAMP FORUM·or·in my email:
····· pjosehills@hotmail.com
Remember that if it's impossible to search the smallest number·or expession·in an array, I would be very happy with a program who can search the smalest number or expression·in a group of numbers. For example :·with the command LOOKDOWN.
Post Edited (Hills) : 11/23/2004 11:13:21 PM GMT
Comments
To make it easy to start with I will assume the number of elements in your array is known.
You can then do the following:
Give the variable 'minimum' a value you expect to be larger then the smallest item in your array.
FOR CountVal=0 TO CountVal=ArraySize
IF P(CountVal)<minimum THEN minimum=P(CountVal)
NEXT
This should work ffor a start
Klaus