4ô > FPickerDemo.bbc 1.00 21-Dec-2015 J.G.Harston 9ô Text-only file picker, independent of any API calls >ô Navigates between directories, returns selected filename (ô 2 ô Bugs: <;ô If catalog scrolls the screen, display becomes messy FSô Can't tell difference between filename with spaces that matches column break P: Z *FX4,1 d$ë 12:ô COLOUR 3:COLOUR 128+4:CLS nõ xñ"File Picker Demo"' ‚A$=¤file_picker Œñ "File picked: ";A$; –A%=¦(200):Û  ý £ ªà ´: ¾ݤfile_picker ÈGê width%,yp0%,yp1%,xp%,yp%,A$,A%,K%,colwidth%,colmax%,fg%,bg%,last% Òcolwidth%=20:ô Hard wired Ü…ô LOCAL ERROR:ON ERROR LOCAL A$=FNfile_highlight(fg%,128+bg%):PRINTTAB(0,yp1%):IF ERR=17:="" ELSE RESTORE ERROR:ERROR ERR,REPORT$ æ+fg%=7:bg%=0:ô fg%=@vdu%?70:bg%=@vdu%?71 ðõ ú yp0%=¼+3 *. :ï 8:width%=±:colmax%=((width%+1) colwidth%)-1:yp1%=¼ &ç colmax%>3:colmax%=3:ô Hard wired "yp%=yp0%+1:xp%=0 ,õ 6!ñŠ(xp% € (yp%<>yp0%))+0,yp%); @#A$=¤file_highlight(bg%,128+fg%) J!ñŠ(xp% € (yp%<>yp0%))+0,yp%); TK%=¹ ^@ô IF K%:IF yp%>yp0%:VDU8:A%=FNscrnchr:VDU9:IFA%<>32:K%=FALSE h6ç K%:ç —A$=32:ç last%:K%=£:çyp%=yp1%:last%=last%‚1 rõ ç K%:K%=¥ ‹ K%=last% |&ý (K%>135 € K%<140) „ K%=13 „ K%=8 † last%=K% -ç K%>127:ç¤file_highlight(fg%,128+bg%)="" šCç K%=136:xp%=xp%-colwidth%:ç xp%<0:xp%=colwidth%*colmax%:K%=139 ¤Cç K%=137:xp%=xp%+colwidth%:ç xp%>colwidth%*colmax%:xp%=0:K%=138 ®;ç K%=138:yp%=yp%+1 :ç yp%>yp1%:yp%=yp%-1:last%=0 ¸;ç K%=139:yp%=yp%-1 :ç yp%"":ÿ "DIR "+A$ þñ Š0,yp0%-3); õ:ñ‰(width%+1);:ý ¼>yp1% ñ Š0,yp0%-3); ý £ &="" 0: :ݤfile_highlight(FG%,BG%) DC%=£:A$="" Nô IF yp%=yp0%:VDU 8,8 Xõ:B%=¤scrnchr:A$=A$+½B%:ï 9 bNç yp%=yp0%:C%=©A$=width% ‹ ç (©A$ ƒ colwidth%=12) „ ±<1:ç ¤scrnchr<33:C%=¹ lý C% vñÄ©A$,½8);:û FG%:û BG%:ñA$; €=A$ Š: ”*ݤscrnchr:A%=135:=((º&FFF4)€&FF00)256 ž: ¨ ݤs(A$) ²È• ÀA$,1)=" ":A$=ÁA$,2):Î ¼!È• ÂA$,1)=" ":A$=ÀA$,©A$-1):Î Æ=A$ ÿ