Dear all:
I would like to open .txt file after I created it.So following are my way, of course, it failed.
m_cml:=&('c:\windows\notepad.exe x:\log\'+m_filename)
EVAL(m_cml)
Complier keep tellinf me error about using '&'
Please help!
I thank you in advance.
Best Regards
chen min
Question about marco
Moderator: Rathinagiri
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Question about marco
Hi Chen Min
Have you tried EXECUTE command ?
Regards
--
Esgici
Have you tried EXECUTE command ?
Regards
--
Esgici
Viva INTERNATIONAL HMG 
-
huangchenmin
- Posts: 157
- Joined: Mon Jun 07, 2010 2:24 am
Re: Question about marco
Thanks for youe supports.esgici wrote:Hi Chen Min
Have you tried EXECUTE command ?
Regards
--
Esgici
I have been tried followig:
run c:\windows\NOTEPAD.exe filename
The mater reall bother me is the file name, whilch is not fixed but depends on random create.
That is the reason make me want to use '&'
Could you explain more about EXECUTE command ?
I tank you in advance.
Best Regards
chen min
Re: Question about marco
Try something like that:
It should help, I think.
Best regards, Marek
Code: Select all
cProg := 'c:\windows\notepad.exe'
cParam := 'x:\log\'+m_filename
_Execute ( GetActiveWindow() ,, cProg , cparam ,, 5 )
Best regards, Marek
-
huangchenmin
- Posts: 157
- Joined: Mon Jun 07, 2010 2:24 am
Re: Question about marco
Dear Marekmol wrote:Try something like that:It should help, I think.Code: Select all
cProg := 'c:\windows\notepad.exe' cParam := 'x:\log\'+m_filename _Execute ( GetActiveWindow() ,, cProg , cparam ,, 5 )
Best regards, Marek
Thanks for your supports.
It realy works.
I replace 'notepad.exe' with 'wordpad.exe', and fail to open .txt file while there is space in path string.
ex. cParam := GetDesktopFolder()+'\'+m_filename
cParam will be 'c:Documents and Settings\...'
please help!
Best Regards
chen min
Re: Question about marco
I've made some test and it works good to me.
I've closed parameter with " characters for sure:
but, it's not necessary, I think.
Are you sure your problems are caused with spaces in file name?
In my Windows XP system, WORDPAD.EXE is NOT placed in WINDOWS directly, but in:
c:\Program Files\Windows NT\Accessories\wordpad.exe
Maybe your problem solution lays here?
I've closed parameter with " characters for sure:
Code: Select all
cParam := '"' + GetDesktopFolder()+'\' + cFile +'"'
Are you sure your problems are caused with spaces in file name?
In my Windows XP system, WORDPAD.EXE is NOT placed in WINDOWS directly, but in:
c:\Program Files\Windows NT\Accessories\wordpad.exe
Maybe your problem solution lays here?
-
huangchenmin
- Posts: 157
- Joined: Mon Jun 07, 2010 2:24 am
Re: Question about marco
Mine either.mol wrote:I've made some test and it works good to me.
I've closed parameter with " characters for sure:but, it's not necessary, I think.Code: Select all
cParam := '"' + GetDesktopFolder()+'\' + cFile +'"'
Are you sure your problems are caused with spaces in file name?
In my Windows XP system, WORDPAD.EXE is NOT placed in WINDOWS directly, but in:
c:\Program Files\Windows NT\Accessories\wordpad.exe
Maybe your problem solution lays here?
I will try again later.
Best Regards
chen min