$ô > BLib.Suffix 1.00 11-Jan-2009 : ô Ensure filename extension (ô ========================= 2;ô Requires: sfx%=>block of memory holding suffixes file <ô FNlc(), FNuc() F: Pô FNfn_sfx(file$,type%) Zô --------------------- d/ô On entry: file$=filename to add suffix to n'ô type%=filetype to match xSô On exit: Returns filename with extended file extension if truncated on entry ‚Yô eg "main/h" -> "main/h", but "mainpage/h" -> "mainpage/htm" if type%=&FAF Œ: –5ݤfn_sfx(n$,t%):êe%,f%,sp%,xt$:ç©n$<10„sfx%=0:=n$  MA%=0:õe%=A%+1:A%=§n$,".",e%):ýA%=0:ç©n$-e%<9:=n$‹e%=§n$,"/",e%):çe%=0:=n$ ªWxt$=¤lc(Án$,e%+1)):sp%=sfx%:õ:f%=À$sp%,©xt$)=xt$:çsp%?3=44:f%=f%€t%= ("&"+$(sp%+4)) ´6A%=sp%:sp%=sp%+1+©$sp%:ý?sp%=13„f%:çf%:xt$=À$A%,3) ¾*çÂn$,1)<="_":çÂn$,1)<>"/":xt$=¤uc(xt$) È=Àn$,e%-1)+"/"+xt$ Ò: ÿ