Prompting user not working ?

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

Prompting user not working ?

Post by CookieMonster »

Code: Select all

$askusr = inputfolder("C:\","Choose Source Folder");
$mvfld = inputselect("Enter folder ",500,400)
foreach($askusr,",","no folders"){
    $strdfldr = gettoken($mvfld,2,",",t);
}
text $strdfldr;
I'd like to know why two things, the inputfolder() and inputselect() functions are not prompting the user for a folder and string; an anything else that may be wrong ?

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

Re: Prompting user not working ?

Post by highend »

Wrong / missing indentation
Missing semicolon in inputselect(...) line
No listdata given for inputselect()
No ListOfTokens given for the loop
Invalid [flags] for the loop
Does it make sense to overwrite the already given $askusr in the loop?
Does it make sense to try to get a fixed (non existing!) index from a not-changing $mvfld in the loop?
Does it make sense to output a (theoretically) changing (on each loop) variable just once after the loop?
One of my scripts helped you out? Please donate via Paypal

CookieMonster

Re: Prompting user not working ?

Post by CookieMonster »

Rather then getting the sub-string; if I ask the user for a string of characters and they enter in only the first five characters of a sub-folder, how can I search for any folders that begin with those first five characters ?
The getToken() function is returning exactly the characters which the user inputs.

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

Re: Prompting user not working ?

Post by highend »

By just putting an asterisks behind the search term. Works for quicksearch() and listfolder() as well...
One of my scripts helped you out? Please donate via Paypal

CookieMonster

Re: Prompting user not working ?

Post by CookieMonster »

When looping over a folder, rather then listing all the sub-folders; I'm only getting the current selected folder ?

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

Re: Prompting user not working ?

Post by highend »

Aha. And the belonging code is?
One of my scripts helped you out? Please donate via Paypal

CookieMonster

Re: Prompting user not working ?

Post by CookieMonster »

Code: Select all

$askusr = inputfolder("C:\","Choose Source Folder");
 $mvfld = input("Enter folder ",500,400);
  foreach($iten,$askusr){
    text $iten;
 }

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

Re: Prompting user not working ?

Post by highend »

You're asking for one folder and then loop over it (whatever the sense of these may be),
maybe you should get the subfolders of it and loop over them?
One of my scripts helped you out? Please donate via Paypal

CookieMonster

Re: Prompting user not working ?

Post by CookieMonster »

highend wrote:You're asking for one folder and then loop over it (whatever the sense of these may be),
maybe you should get the subfolders of it and loop over them?
I know it doesn't make sense.
If your hinting I use the get function, after reading what this function can do, I don't see anything related to getting the sub-folders ?

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

Re: Prompting user not working ?

Post by highend »

It wasn't a hint about that function. What you need is mentioned in post nr. 4
One of my scripts helped you out? Please donate via Paypal

CookieMonster

Re: Prompting user not working ?

Post by CookieMonster »

Code: Select all

$deepsrch = confirm("Deep Search ?",2,1);
How do I get the yes & no prompt rather then the current OK & cancel prompt ?

Also whether using yes & no or OK & Cancel, either returns 0 or 1; therefore if I'm using a condition, I assume checking if it's equal to 1 or equal to 0 should work? If that is the case, it's not working.
Example;

Code: Select all

$deepsrch == 1 
<run code>

Code: Select all

$deepsrch == 0
<run code>
How can you check sub-folders which are hidden ? I want to scan some sub-folders but they are nested within a hidden sub-folder and listfolders() stops.

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

Re: Prompting user not working ?

Post by highend »

How do I get the yes & no prompt rather then the current OK & cancel prompt ?
By reading the help file entry for confirm?
I assume checking if it's equal to 1 or equal to 0 should work?
Sure it does. And, is there a check in your code? No, it isn't...
How can you check sub-folders which are hidden ?
Quick search accepts switches. One of them is "find all items...". The help file knows more...
One of my scripts helped you out? Please donate via Paypal

CookieMonster

Re: Prompting user not working ?

Post by CookieMonster »

The last argument for confirm() is either 1,2,3,4; therefore if I want yes & no, I use 4.
Then this should work;

Code: Select all

confirm("?",1,4);
correct ?

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

Re: Prompting user not working ?

Post by highend »

No, count the parameters...
One of my scripts helped you out? Please donate via Paypal

CookieMonster

Re: Prompting user not working ?

Post by CookieMonster »

highend wrote:No, count the parameters...
?

Post Reply