Prompting user not working ?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
CookieMonster
Posts: 650
Joined: 14 Nov 2012 19:56
Location: Toronto
Contact:

Prompting user not working ?

Postby CookieMonster » 13 Sep 2018 00:21

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 ?
Good Citizens Don't Think.
Thinking leads to Reasoning. Reasoning leads to right & wrong. Wrong leads to Revolt. Revolt leads to Bad Citizens.
The Rothschild ideology it could be George Soros ideology as well.

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

Re: Prompting user not working ?

Postby highend » 13 Sep 2018 06:17

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 or highend (at) web (dot) de

CookieMonster
Posts: 650
Joined: 14 Nov 2012 19:56
Location: Toronto
Contact:

Re: Prompting user not working ?

Postby CookieMonster » 13 Sep 2018 15:54

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.
Good Citizens Don't Think.
Thinking leads to Reasoning. Reasoning leads to right & wrong. Wrong leads to Revolt. Revolt leads to Bad Citizens.
The Rothschild ideology it could be George Soros ideology as well.

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

Re: Prompting user not working ?

Postby highend » 13 Sep 2018 16:15

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 or highend (at) web (dot) de

CookieMonster
Posts: 650
Joined: 14 Nov 2012 19:56
Location: Toronto
Contact:

Re: Prompting user not working ?

Postby CookieMonster » 14 Sep 2018 03:03

When looping over a folder, rather then listing all the sub-folders; I'm only getting the current selected folder ?
Good Citizens Don't Think.
Thinking leads to Reasoning. Reasoning leads to right & wrong. Wrong leads to Revolt. Revolt leads to Bad Citizens.
The Rothschild ideology it could be George Soros ideology as well.

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

Re: Prompting user not working ?

Postby highend » 14 Sep 2018 08:01

Aha. And the belonging code is?
One of my scripts helped you out? Please donate via Paypal or highend (at) web (dot) de

CookieMonster
Posts: 650
Joined: 14 Nov 2012 19:56
Location: Toronto
Contact:

Re: Prompting user not working ?

Postby CookieMonster » 14 Sep 2018 14:12

Code: Select all

$askusr = inputfolder("C:\","Choose Source Folder");
 $mvfld = input("Enter folder ",500,400);
  foreach($iten,$askusr){
    text $iten;
 }
Good Citizens Don't Think.
Thinking leads to Reasoning. Reasoning leads to right & wrong. Wrong leads to Revolt. Revolt leads to Bad Citizens.
The Rothschild ideology it could be George Soros ideology as well.

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

Re: Prompting user not working ?

Postby highend » 14 Sep 2018 14:57

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 or highend (at) web (dot) de

CookieMonster
Posts: 650
Joined: 14 Nov 2012 19:56
Location: Toronto
Contact:

Re: Prompting user not working ?

Postby CookieMonster » 14 Sep 2018 22:08

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 ?
Good Citizens Don't Think.
Thinking leads to Reasoning. Reasoning leads to right & wrong. Wrong leads to Revolt. Revolt leads to Bad Citizens.
The Rothschild ideology it could be George Soros ideology as well.

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

Re: Prompting user not working ?

Postby highend » 14 Sep 2018 22:10

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 or highend (at) web (dot) de

CookieMonster
Posts: 650
Joined: 14 Nov 2012 19:56
Location: Toronto
Contact:

Re: Prompting user not working ?

Postby CookieMonster » 15 Sep 2018 01:20

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.
Good Citizens Don't Think.
Thinking leads to Reasoning. Reasoning leads to right & wrong. Wrong leads to Revolt. Revolt leads to Bad Citizens.
The Rothschild ideology it could be George Soros ideology as well.

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

Re: Prompting user not working ?

Postby highend » 15 Sep 2018 08:01

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 or highend (at) web (dot) de

CookieMonster
Posts: 650
Joined: 14 Nov 2012 19:56
Location: Toronto
Contact:

Re: Prompting user not working ?

Postby CookieMonster » 16 Sep 2018 17:50

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 ?
Good Citizens Don't Think.
Thinking leads to Reasoning. Reasoning leads to right & wrong. Wrong leads to Revolt. Revolt leads to Bad Citizens.
The Rothschild ideology it could be George Soros ideology as well.

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

Re: Prompting user not working ?

Postby highend » 16 Sep 2018 17:54

No, count the parameters...
One of my scripts helped you out? Please donate via Paypal or highend (at) web (dot) de

CookieMonster
Posts: 650
Joined: 14 Nov 2012 19:56
Location: Toronto
Contact:

Re: Prompting user not working ?

Postby CookieMonster » 16 Sep 2018 18:36

highend wrote:No, count the parameters...

?
Good Citizens Don't Think.
Thinking leads to Reasoning. Reasoning leads to right & wrong. Wrong leads to Revolt. Revolt leads to Bad Citizens.
The Rothschild ideology it could be George Soros ideology as well.


Return to “Tips & Tricks, Questions & Answers”



Who is online

Users browsing this forum: No registered users and 1 guest