[Gambas-user] How to specify a string constant in an Exec statement

John Rose john.aaron.rose at gmail.com
Sun Jul 12 20:38:45 CEST 2020

1. There is no closing ]
Apologies: my typo.

2. Exec does NOT pre-process the arguments you give it. Try
     get_iplayer '\".\"' --type=TV
   in a terminal and see what it says. You have to understand exactly 
what gambas sends to the exec system call. N.B. exec system call not 
"Exec" system call.
There should be a * in the above. I tried it with & without. Didn't work 
i.e. TextAreaOutput in attached TestApp2 didn't display anything.

3. try in gambas
     Exec ["get_iplayer","'.*","--type=TV"] To sOutput
   It's a guess
Didn't work.

4. Pay particular attention to the single and double quotes in the above.
  I have: see below for successful solution.

5. Is not going to work because there is NO SHELL to expand the .*
read the fine help.
I forgot about . and * being characters in a command that needed a Shell 
statement rather than an Exec statement.

Now working with:
Shell "get_iplayer \".*\" --type=tv" To sOutput
Shell "get_iplayer --type=tv \".*\"" To sOutput


-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestApp2.tar.gz
Type: application/gzip
Size: 12353 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200712/153eec0b/attachment-0001.gz>

More information about the User mailing list