Hi Andreas!
I've a problem with MatchPattern() command...
If in the patterns to match was present a"(" or a ")" the command dont works...simply dont recognize the files...eg returns always FALSE
Is that normal or was a bug?
Thank you!
MatchPattern() problem/bug ?
MatchPattern() problem/bug ?
Simone"Tuxedo"Monsignori, Perugia, ITALY.
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: MatchPattern() problem/bug ?
Got an example? The following works here:
It returns 1 as expected and there are parentheses in the pattern.
Code: Select all
DebugPrint(MatchPattern("dev:hollywood/test/pic.png", "#?.(iff|bmp|png)"))
Re: MatchPattern() problem/bug ?
maybe the problem was if parentheses was in the base pattern?
I cant compare:
moon:ATA/Benkyo 47/Gallery/Gallery (102).jpg
With itself(to look in a table where it is...).
In all the other cases I tryed it works.
dont works also if I try to match only the file name...
Where I'm wong?
Thank you!
I cant compare:
moon:ATA/Benkyo 47/Gallery/Gallery (102).jpg
With itself(to look in a table where it is...).
In all the other cases I tryed it works.
dont works also if I try to match only the file name...
Where I'm wong?
Thank you!
Simone"Tuxedo"Monsignori, Perugia, ITALY.
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: MatchPattern() problem/bug ?
Oh well, what you're trying to do is clearly more than pattern matching is designed to do AFAICS, AmigaDOS patterns use parentheses as tokens so you will run into trouble if you try to use them as non-tokens. This is not a Hollywood bug, it's related to the way patterns work in AmigaDOS.
Re: MatchPattern() problem/bug ?
You are right however the file that gives me the problem was a file from a CD...so the original author probably dont care much about AmigaOS tokens and other things...unfortunately...
Simone"Tuxedo"Monsignori, Perugia, ITALY.
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: MatchPattern() problem/bug ?
Of course you can always write your own pattern matching routines
Re: MatchPattern() problem/bug ?
Ok,
I solved the problem changing the MatchPattern line with that:
IF FindStr((fileDIR$ .. file$[j]), FileSelect$) = 0
Now it works perfectly
Really simple solution
I solved the problem changing the MatchPattern line with that:
IF FindStr((fileDIR$ .. file$[j]), FileSelect$) = 0
Now it works perfectly
Really simple solution
Simone"Tuxedo"Monsignori, Perugia, ITALY.