Nov 9, 2004 #1 creon Technical User Jul 28, 2004 5 0 0 US Good morning all! I am trying to count the number of instances of the number 2 in a long string of numbers but do not know the corrent syntax of the formula. Ex: 4 6 1 2 9 0 4 1 2 2 5 4 <-- count the number of 2 in the string Any ideas? Creon
Good morning all! I am trying to count the number of instances of the number 2 in a long string of numbers but do not know the corrent syntax of the formula. Ex: 4 6 1 2 9 0 4 1 2 2 5 4 <-- count the number of 2 in the string Any ideas? Creon
Nov 9, 2004 #2 ianoctdec Programmer Feb 6, 2003 190 0 0 CA Hi creon, Try this: whileprintingrecords; numbervar count2; numbervar i; stringvar mystring = '461290412254'; for i := 1 to len (mystring) do( if mystring = '2' then count2 := count2 + 1 ); count2 Hope it helps! Dana Upvote 0 Downvote
Hi creon, Try this: whileprintingrecords; numbervar count2; numbervar i; stringvar mystring = '461290412254'; for i := 1 to len (mystring) do( if mystring = '2' then count2 := count2 + 1 ); count2 Hope it helps! Dana