typeof class = S;; typeof file = S;; fun cbDestroy(o,docName) = _RSunregister this docName; 0 ;; fun extension(fi) = let 0->j in let 0->find in ( while ((set find=strfind "." fi j)!=nil) do ( set j=find+1 ); substr fi j (strlen fi)-j ) ;; fun cbRegister (ui, cli, action, param, z) = let z -> [o fileName nrand] in let if fileName == nil then "logo.bmp" else fileName -> fileName in ( let (strcatn "tmp/logo/"::(substr _getlongname /* strcat nrand */ /* comment by iri */ (substr fileName 0 (strfind "." fileName 1)) "" "#" 1 8)::"."::(extension fileName)::nil) -> fileNameOnClient in /* ??? modifié */ if (_checkpack fileNameOnClient) == nil then UsendMessage ui cli "registered" linebuild "logo.bmp"::"logo.bmp"::nil else UsendMessage ui cli "registered" linebuild fileNameOnClient::file::nil; 0 ) ;; fun newOb(o) = let hd UgetParam ObUi o "fichier" -> fileName in let hd UgetParam ObUi o "nrand" -> nrand in /* ??? ajouté par moi */ let strcat ObName o fileName -> docName in ( _RSregister this docName RScontrol+RSfile (strcatn "tmp/logo/"::(substr _getlongname strcat nrand (substr fileName 0 (strfind "." fileName 1)) "" "#" 1 8)::"."::(extension fileName)::nil); /*??? modifié par moi */ ObCbDestroy o mkfun2 @cbDestroy docName; UcbMessage ObUi o ["register" mkfun5 @cbRegister [o fileName nrand]]:: /* ???modifié */ nil; set file = fileName; 0 ) ;; fun IniPlug(file) = set class=getInfo strextr _getpack _checkpack file "name"; PlugRegister class @newOb nil; 0 ;;