Page 1 of 2

Prompting user not working ?

Posted: 13 Sep 2018 00:21
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 ?

Re: Prompting user not working ?

Posted: 13 Sep 2018 06:17
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?

Re: Prompting user not working ?

Posted: 13 Sep 2018 15:54
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.

Re: Prompting user not working ?

Posted: 13 Sep 2018 16:15
by highend
By just putting an asterisks behind the search term. Works for quicksearch() and listfolder() as well...

Re: Prompting user not working ?

Posted: 14 Sep 2018 03:03
by CookieMonster
When looping over a folder, rather then listing all the sub-folders; I'm only getting the current selected folder ?

Re: Prompting user not working ?

Posted: 14 Sep 2018 08:01
by highend
Aha. And the belonging code is?

Re: Prompting user not working ?

Posted: 14 Sep 2018 14:12
by CookieMonster

Code: Select all

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

Re: Prompting user not working ?

Posted: 14 Sep 2018 14:57
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?

Re: Prompting user not working ?

Posted: 14 Sep 2018 22:08
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 ?

Re: Prompting user not working ?

Posted: 14 Sep 2018 22:10
by highend
It wasn't a hint about that function. What you need is mentioned in post nr. 4

Re: Prompting user not working ?

Posted: 15 Sep 2018 01:20
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.

Re: Prompting user not working ?

Posted: 15 Sep 2018 08:01
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...

Re: Prompting user not working ?

Posted: 16 Sep 2018 17:50
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 ?

Re: Prompting user not working ?

Posted: 16 Sep 2018 17:54
by highend
No, count the parameters...

Re: Prompting user not working ?

Posted: 16 Sep 2018 18:36
by CookieMonster
highend wrote:No, count the parameters...
?