[REBOL] Re: request-dir
From: carl:cybercraft at: 3-Sep-2002 18:49
Hi Ashley,
I get the following error with the function...
** Script Error: remove-each has no value
** Where: do-facets
** Near: insert remove-each file read path
I'm guessing remove-each is a function from the beta REBOLs?
Carl.
On 03-Sep-02, [atruter--hih--com--au] wrote:
> Reply to self,
> The following code (on windows) seems to do the trick:
> <code>
> request-dir: function [path] [where lst] [
> view center-face layout [
> where: info 300 form path
> lst: text-list 300x200 data insert remove-each file read
> path [not dir? path/:file] %../ [
> either path <> %/ [
> path: dirize clean-path join path lst/picked/1
> ][
> either not none? attempt [open dirize
> lst/picked/1] [
> path: dirize lst/picked/1
> ][
> alert "Device not ready."
> ]
> ]
> lst/lines: remove-each file read path [not dir?
> path/:file]
> if path <> %/ [insert lst/lines %../]
> ; Refresh list
> clear lst/picked
> lst/sld/data: 0
> lst/sn: 0
> lst/sld/redrag lst/lc / max 1 length? head lst/lines
> show lst
> ; Refresh text
> where/text: path
> show where
> ]
> btn "Select" [unview]
> ]
> path
> ]
> new-dir: request-dir %/c/rebol/
> </code>
> Note the use of "port" to determine whether removable media
> (typically %/a/ on windows) is actually present. Is this a good
> technique? (I don't know whether using port without a matching close
> is *a bad thing* or not).
> Regards,
> Ashley
--
Carl Read