Welcome, Guest. Please login or register.

Author Topic: Parameters in RequestChoice / RequestFile commands  (Read 2464 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline nbache

Re: Parameters in RequestChoice / RequestFile commands
« on: November 23, 2020, 10:10:05 PM »
The following works for me in 4.1.

Code: [Select]
Set Infile `Requestfile TITLE "Input"`
Set Outfile `Requestfile TITLE "Output"`
Set Confirm `RequestChoice TITLE "Confirm" Body "$Infile*n$Outfile" "Quit"`
Echo $Confirm

(The last line is just to verify the RequestChoice worked as expected.)

I would expect that it would also work in 3.x, but of course I can't guarantee it.

Still, maybe it can inspire some new attempts.

Best regards,

Niels
 

Offline nbache

Re: Parameters in RequestChoice / RequestFile commands
« Reply #1 on: November 24, 2020, 11:26:05 PM »
My pleasure :-)

BTW, there may still be some precautions to take if the file/path happens to contain spaces or other annoying stuff - I didn't test that.

(This is where I'm supposed to say "left as an exercise for the reader ;-)).

Best regards,

Niels
 

Offline nbache

Re: Parameters in RequestChoice / RequestFile commands
« Reply #2 on: November 25, 2020, 04:18:15 PM »
@AndyFC:

Quote
I've got a plan of how to deal with the spaces in the path.
*SPOILER ALERT*

Just in case you haven't found a good way yet (or someone else wants a solution):

Code: [Select]
Set Infile `Requestfile TITLE "Input"`
Set Outfile `Requestfile TITLE "Output"`
Set Confirm `RequestChoice TITLE "Confirm" Body "*"$Infile*"*n*"$Outfile*"" "Quit"`
Echo $Confirm

Edit: Hmm ... under 4.1, paths with spaces actually work already without that modification. Under 3.x, YMMV.

Best regards,

Niels
« Last Edit: November 25, 2020, 04:26:44 PM by nbache »