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

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

Procedure calc_register.cln(s:String);
Label derr,norm,ex;
Var i,l,j:byte;
    ch,ch1:char; s1:String;
    r:real; o:integer;
Begin
  i:=pos('ln',s); delete(s,i,3); 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 r<=0 Then Goto derr;
     If (ch='a') Or (ch='A') Then a:=ln(r);
     If (ch='b') Or (ch='B') Then b:=ln(r);
     If (ch='c') Or (ch='C') Then c:=ln(r);
     If (ch='d') Or (ch='D') Then d:=ln(r);
     If (ch='e') Or (ch='E') Then e:=ln(r);
     If (ch='f') Or (ch='F') Then f:=ln(r);
     If (ch='g') Or (ch='G') Then g:=ln(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 r<=0 Then Goto derr;
     If (ch='a') Or (ch='A') Then a:=ln(r);
     If (ch='b') Or (ch='B') Then b:=ln(r);
     If (ch='c') Or (ch='C') Then c:=ln(r);
     If (ch='d') Or (ch='D') Then d:=ln(r);
     If (ch='e') Or (ch='E') Then e:=ln(r);
     If (ch='f') Or (ch='F') Then f:=ln(r);
     If (ch='g') Or (ch='G') Then g:=ln(r);
  End;

  norm:
  settextstyle(smallfont,horizdir,5);
  With pinterf^ Do Begin
       s_[1]:='';
       outhelp;
  End; Goto ex;

  derr:
  settextstyle(smallfont,horizdir,5);
  With pinterf^ Do Begin
       s_[1]:='ln, r<=0 !!!';
       outhelp;
  End;


  ex:
End;