Subject Re: notepad suddenly stops working in dbase
From Mervyn Bick <invalid@invalid.invalid>
Date Sat, 6 Mar 2021 12:40:56 +0200
Newsgroups dbase.getting-started
Attachment(s) run_notepad.prg

On 2021/03/06 11:29, charlie wrote:
> This has always worked and still does on other computers:
>
> run notepad.exe ztext.csv

If it will execute from the dBASE Command Panel I have no idea why it
won't execute from within a dBASE program.  It's not being helpful if I
tell you it works for me in a program.  It does, however, open a DOS
window which is not particularly a problem but it's a bit unsightly.

Save the attached run_notepad.prg and then try the following from the
dBASE Command Panel and then from within a program.

   run_notepad('ztest.csv')

If run_notepad.prg is not in your working directory you will need to
make it available by using

set procedure to c:\whatever\run_notepad.prg

before you execute run_notepad()

Mervyn.



function Run_Notepad(cFile)
   if type( "ShellExecute" ) # "FP"
      extern cHandle ShellExecute( cHandle, cString, cString,;
                                   cString, cString, cInt ) shell32 from "ShellExecuteA"
   endif
   ShellExecute( _app.framewin.hwnd, "open","notepad", cFile, null,1 )
   return