/* ** ** ARexx program to calc with Henry and ARcalc ** ** Copyright 1998 By HANS ROSLOOT H^ns @ #amiganl ** ** This simple script just must be in henry:arexx/ ** ** ARcalc from aminet must be in C: */ OPTIONS RESULTS OPTIONS FAILAT 100 PARSE ARG Nick Hoststring Channel PublicReply Sentence CALL startarcalc if(pos('HENRY.', address()) > 0) then fromhenry = 1 endif p=' '||address()||' '||show('P',,) if pos(' HENRY.',p)>0 then henryport=word(substr(p,pos(' HENRY.',p)+1),1) else do say 'No HENRY port found!' exit(0) end 'address henryport' /* to spy on the use of this cmd replace YOURNICK with yournick [:~) Notice "YOURNICK" Nick "usess calc on " Channel */ IF Sentence = "" THEN DO Notice Nick "log Ln sin cos tan Pi e + - * / % ^ input as or ~~~~~ Bolerean and or xor not input as or " EXIT END Lang = WORDS(Sentence) Som = "" DO Teller = 1 TO WORDS(Sentence) Som = Som || WORD(Sentence,Teller) END Fl = 1 address ARCALCPORT Eval Som IF RC > 0 THEN Fl = 0 Resul = RESULT 'address henryport' IF Fl = 0 THEN DO Notice Nick "Sorry " ARCALC_ERROR EXIT END Notice Nick "The answer on" Sentence " =" Resul EXIT startarcalc: IF (POS( 'RCALCPORT', SHOW( 'Ports' ) ) = 0) THEN DO Max_Seconds_To_Load = 5 Flag = 0 CALL TIME( 'R' ) DO WHILE (TIME( 'E' ) < Max_Seconds_To_Load) & (POS( 'ARCALCPORT', SHOW( 'Ports' ) ) = 0) IF (Flag = 0) THEN DO /* Set whatever command line arguments you want. */ ADDRESS COMMAND 'Run < nil: > nil: C:ARcalc' Flag = 1 END ADDRESS COMMAND 'Wait 2' IF (POS( 'RCALCPORT', SHOW( 'Ports' ) ) = 0) THEN DO Notice Nick "sorry there is something wrong" say "exit de poort is er niet" EXIT END END END RETURN