Help - Search - Members - Calendar
Full Version: $if question
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Support - (fb2k)
stampgevaar
If the word vinyl is present in %path% I like to display vinyl and else cd.

Is this possible to do cause I can't get it figured out. I tried the %replace string but the real problem lies in the fact that the place of the word vinyl varies in the path. so it could be vinyl/...records/name but it can also be vinyl/....records/..../name

is it possible to do this can somebody please help me

thanks in advance
agent s.
$if($strstr(%path%,vinyl),vinyl,cd)
Synthetic Soul
It may be worth checking for "\vinyl\" instead of "vinyl" to stop some false positives (e.g.: if the word is used in an artist or album name).

CODE
$if($strstr(%path%,\vinyl\),vinyl,cd)

Also, bear in mind $strstr() is case-sensitive. As you Shift key doesn't appear to work I guess this won't affect you. wink.gif
Yotsuya
CODE
$if($strstr($lower(%path%),$char(92)vinyl$char(92)),Vinyl,CD)
Synthetic Soul
May I ask why $char(92)? Does using '\' cause problems?
stampgevaar
thanks biggrin.gif works like a charm!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.