NBPrg40. (*Ext_source). (**NBPRG40U). (***inc). (****CalcWS). ccos.inc. MiniOS. OpenSource.

NBPrg40. (*Ext_source). (**NBPRG40U). (***inc). (****CalcWS). ccos.inc. MiniOS. OpenSource.
***************************************

Procedure calc_register.ccos(s:String);
Var i,l,j:byte;
    ch,ch1:char; s1:String;
    r:real; o:integer;
Begin
  i:=pos('cos',s); delete(s,i,4); ch:=s[1];
  l:=length(s); s1:='';
  For i:=1 To l Do
      If ((48<=ord(s[i])) And (ord(s[i])<=57))
          Or (s[i]='+') Or(s[i]='.')
          Or (s[i]='-') Or (s[i]='E') Then s1:=s1+s[i];
  ch1:=s[3];
  If s1<>'' Then Begin
     val(s1,r,o);
     If (ch='a') Or (ch='A') Then a:=cos(r);
     If (ch='b') Or (ch='B') Then b:=cos(r);
     If (ch='c') Or (ch='C') Then c:=cos(r);
     If (ch='d') Or (ch='D') Then d:=cos(r);
     If (ch='e') Or (ch='E') Then e:=cos(r);
     If (ch='f') Or (ch='F') Then f:=cos(r);
     If (ch='g') Or (ch='G') Then g:=cos(r);
  End Else Begin
     If (ch1='a') Or (ch1='A') Then r:=a;
     If (ch1='b') Or (ch1='B') Then r:=b;
     If (ch1='c') Or (ch1='C') Then r:=c;
     If (ch1='d') Or (ch1='D') Then r:=d;
     If (ch1='e') Or (ch1='E') Then r:=e;
     If (ch1='f') Or (ch1='F') Then r:=f;
     If (ch1='g') Or (ch1='G') Then r:=g;
     If (ch='a') Or (ch='A') Then a:=cos(r);
     If (ch='b') Or (ch='B') Then b:=cos(r);
     If (ch='c') Or (ch='C') Then c:=cos(r);
     If (ch='d') Or (ch='D') Then d:=cos(r);
     If (ch='e') Or (ch='E') Then e:=cos(r);
     If (ch='f') Or (ch='F') Then f:=cos(r);
     If (ch='g') Or (ch='G') Then g:=cos(r);
  End;
End;