Hi,
> Oops, it occurs to me that I forgot to add the tail refinement to my first
> find (meaning a file feeder~fodder.r~ would be missed for example). This
> should work better:
>
> has-backup-file?: func [
> {Returns true if any item in block ends with r~}
> arg [block!]
> ][
>
One possible solution is:
>> stuff: [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r %instinet.r~
[%lconfig.r %lconfig.r~ %nntp.r %notes.html %rebdoc.r %dummy.ftp
[%dummy2.ftp~ %readby.ftp]
== [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r %instinet.r~
%lconfig.r %lconfig.
Oops, it occurs to me that I forgot to add the tail refinement to my first
find (meaning a file feeder~fodder.r~ would be missed for example). This
should work better:
has-backup-file?: func [
{Returns true if any item in block ends with r~}
arg [block!]
][
forall arg [
This one and the one before won't work as asked because they'll return
true for files with r~ anywhere in the name. Try this instead (off the top
of my head):
has-backup-file?: func [
{Returns true if any item in block ends with r~}
arg [block!]
][
forall arg [
al Message -
From:
[EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 07, 2000 8:17
AM
Subject: [REBOL] Second request for help:
globbing on a block of filenames
I have a block which contains filenames. I would like to get a
true or false value back indica
Hi,
Or even -
test-for-ext: func [
"Search a block for items ending with the given string. Returns TRUE or
FALSE"
value [string!]
data [block!]
] [
foreach item data [
if find/last item value [ return true ]
false
]
]
cheers, john
>
I have a block which con
Hi,
Try -
test-for-ext: func [
"Search a block for items ending with the given string. Returns TRUE or
FALSE"
value [string!]
data [block!]
] [
foreach item data [
if find/reverse tail item value [ return true ]
false
]
]
cheers, john
>
I have a block which
I have a block which contains filenames. I would like to get a true or false value
back indicating whether or not there is a filename in the block that terminates with a
r~ extension.
Please show me how to do this.
>> a
== [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r %instinet.r~ %lconfig.r