find in a block doesn't find ?
[1/2] from: peoyli:algonet:se at: 26-Apr-2001 13:03
Hi,
Noticed this one..
files: [
%310-009_2001-03.tar.gz %desc
%qotd-2000-12-28.txt %qotd-2001-02-28.txt %qotd-2001-03-02.txt
%qotd-2001-03-03.txt %qotd-2001-03-04.txt %qotd-2001-03-05.txt
%qotd-2001-03-06.txt %qotd-2001-03-07.txt %qotd-2001-03-08.txt
]
>> find/any files %qotd-2001-03*
== none
>> find/any files %qotd-2001-03-04*
== none
>> find/any files %qotd-2001-03-04.txt*
== none
>> find/any files %qotd-2001-03-04.txt
== [%qotd-2001-03-04.txt %qotd-2001-03-05.txt
%qotd-2001-03-06.txt %qotd-2001-03-07.txt %qotd-2001-03-08.txt
]
in the last test it works, but then, the purpose of using 'find' is lost..
A work-around would be to check every value in the block separately..
either none? foreach file files [if find/any file %qotd-2001-05* [break]]
[print "not found"] [print "found"]
not found
either none? foreach file files [if find/any file %qotd-2001-03* [break]]
[print "not found"] [print "found"]
found
.. but is this the only way ? I only need to know if there is any file that
starts with the specified part (part of a CGI input validation)..
/PeO
[2/2] from: volker nitsch:crosswinds at: 21-Jun-2001 22:25
RE: [REBOL] find in a block doesn't find ?
[peoyli--algonet--se] wrote:
> Hi,
> Noticed this one..
<<quoted lines omitted: 16>>
> in the last test it works, but then, the purpose of using 'find' is lost..
> A work-around would be to check every value in the block separately..
Not a workaround, its innded to work that way.
you can find the wildcard-position in a string.
not a string in a block
-Volker
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted