Hello! I have this algorithm, and the problem is that the list(L6) doesnt hold it data as it should.
Code:
!= means not eqal to
-> means store
Str9 is function previously converted from Y1 to string.
Basically what this code is doing is its searching for all + and - withint the function that are not within functions in Str0(beginning from position 3). The only thing that isnt working properly is this line:
Code:
What its supposed to do is to list plus and minus signs in the order in which they were found, but the result is diffrent. Any ideas?
Code:
"+-sin(cos(tan(log(ln(("->Str0
For(I,1,2)
inString(Str9,sub(Str0,I,1))
Repeat not(Ans
If Ans != 0 Then
Ans -> A:0->P:0->T
For(J,3,length(Str0))
sub(Str0,J,1)->Str8
inString(Str9,Ans,P+1)
If Ans = 0 or Ans > A Then
1+T->T:A
End
While Ans<A
inString(Str9,Str8,P+1)
inString(Str9,")",Ans+1)
If Ans<A and (inString(Str9,Str8,Ans+1)=0 or inString(Str9,Str8,Ans+1)>A Then
1+t->T:A
Else
Ans->P
End
End //while
End //for
If T = length(Str0)-2 Then
A ->L6(1+dim(L6)):0->T
End
End //If
inString(Str9,sub(Str0,I,1),A+1)
End //Repeat
End //For
!= means not eqal to
-> means store
Str9 is function previously converted from Y1 to string.
Basically what this code is doing is its searching for all + and - withint the function that are not within functions in Str0(beginning from position 3). The only thing that isnt working properly is this line:
Code:
A->L6(1+dim(L6))
What its supposed to do is to list plus and minus signs in the order in which they were found, but the result is diffrent. Any ideas?