read numbers from 2 separate strings, compare and/or calculate, and record result

coder4life

Member
Joined
Sep 25, 2013
Messages
9
Programming Experience
1-3
i have 2 strings where the average in one matches the high in the other.

the High string has this

15428
15433
15424
15423
15429
15438
15432
15434
15428
15437
15446

The Average string has this:

15425
15426
15431
15435
15440
15446
15451
15455
15459
15464
15468



what i want to do is read row 1 of High and compare it with row 1 of Average

example

if row 1 of High (15428) is <= row 1 of Average (15425) then enter 1, else enter 0, and save it to an array/string

the results would be

0
0
1
1
1
1
1
1
1
1
1

then, once these results are in, i will want to count the consecutive instances of that condition

for example

0
0
1
1
1
1
1
1
1
1
1

would be 9, to be entered in another array/string

and assuming a result that looked like the following example

0
0
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
0
1
1
1
1
1
1
1
1
0

the result, recorded separately, would be

9
4
8

from there i want to know what number in the last string/array is the MAX

TIA
 
I'm going to tell you once and for all, STOP working with these ridiculous strings! If what you want to do is work with numbers then work with numbers. If you get your input as a single String like that then we can show you, once and once only, how to convert that input to a list of numbers. You can then stop asking us over and over how to do something with a String because you'll already know how to convert that String to a list of numbers. You can then just ask how to do something with a list of numbers because that's what you actually need to do.

So, please answer this question: where EXACTLY is this String coming from?
 
Back
Top