Listing files for current path ?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
CookieMonster

Listing files for current path ?

Post by CookieMonster »

Why doesn't the seventh line print the list of files for the current path ?

Code: Select all

if($deepsrch==1){
     foreach($nn,$askusr){
     $fList = gettoken($mvfld,1,"|",t,1);
     quicksearch($fList,$nn,<crlf>,n);
     text getpathcomponent($nn,"parent",1,1);
     if($askusr==<curpath>){
     text listfolder(<curpath>,"*.jpg",1,"|");
    }
     }
    }

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Listing files for current path ?

Post by highend »

Probably because

Code: Select all

if($askusr==<curpath>){
isn't true?

What is the reason to use quicksearch() if you don't assign what it returns to a variable?
One of my scripts helped you out? Please donate via Paypal

CookieMonster

Re: Listing files for current path ?

Post by CookieMonster »

It's always going to be true, it's simple a check.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Listing files for current path ?

Post by highend »

So,

Code: Select all

text getpathcomponent($nn,"parent",1,1);
is executed but

Code: Select all

text listfolder(<curpath>,"*.jpg",1,"|");
isn't?

And (if that's the case) you tell us that the if check is always true...

Check that logic... Twice!

It's a string comparison, if only a single character is different (e.g. lower- vs uppercase) the check fails...
One of my scripts helped you out? Please donate via Paypal

Post Reply