shellexecute()

68 views
Skip to first unread message

timepro timesheet

unread,
Sep 8, 2022, 4:50:28 AMSep 8
to
taxfile='Z:\TAX\EINVOICE\010922_080922.XXX' // (text file)
from inside my app, how to open it in a browser:
SHELLEXECUTE( 0, 0, taxfile, 0, 0, 1 ) opens the file in notepad.

thank you

dlzc

unread,
Sep 8, 2022, 1:53:24 PMSep 8
to
I think you need to pass "chrome @taxfile", or whatever browser is installed. A different kettle of fish.

David A. Smith

timepro timesheet

unread,
Sep 9, 2022, 9:27:12 AMSep 9
to
thank you.

nope, did not open the taxfile. ('chrome@taxfile')
so, i just copied the .json(text) file to temp.HTML.
now, shellexecute(...temp.html...) opens in the browser for viewing.
(after exit, delete temp.html)
but some lines are 350+ char long, chrome doesn't wrap/scroll that line. the user can view only that fits the screen).

-if i open as shellexecute(...taxfile...), it opens in notepad, which the user can inadvertently edit.

dlzc

unread,
Sep 9, 2022, 12:26:49 PMSep 9
to
On Friday, September 9, 2022 at 6:27:12 AM UTC-7, timec...@gmail.com wrote:
> nope, did not open the taxfile. ('chrome@taxfile')

I think the space is required 'chrome @taxfile'. Clipper should have "macro substituted" in the string, but you can always explicitly
"chrome " + chr(34) + taxfile + chr(34) (as an argument in your shellexecute)
... when passing, but line length as you state is still a problem

...
> -if i open as shellexecute(...taxfile...), it opens in
> notepad, which the user can inadvertently edit.

Could:
Mark the file readonly, prior to passing, and
Pass it to wordpad ('wordpad @taxfile'). Or the harder-to-read explicit version above.

David A. Smith
Reply all
Reply to author
Forward
0 new messages