Question about marco

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Question about marco

Post by huangchenmin »

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
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Question about marco

Post by esgici »

Hi Chen Min

Have you tried EXECUTE command ?

Regards

--

Esgici
Viva INTERNATIONAL HMG :D
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: Question about marco

Post by huangchenmin »

esgici wrote:Hi Chen Min
Have you tried EXECUTE command ?
Regards
--
Esgici
Thanks for youe supports.
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
User avatar
mol
Posts: 3825
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Question about marco

Post by mol »

Try something like that:

Code: Select all

cProg	:= 'c:\windows\notepad.exe'
cParam := 'x:\log\'+m_filename
_Execute ( GetActiveWindow() ,, cProg , cparam ,, 5 )
It should help, I think.

Best regards, Marek
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: Question about marco

Post by huangchenmin »

mol wrote:Try something like that:

Code: Select all

cProg	:= 'c:\windows\notepad.exe'
cParam := 'x:\log\'+m_filename
_Execute ( GetActiveWindow() ,, cProg , cparam ,, 5 )
It should help, I think.
Best regards, Marek
Dear 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
User avatar
mol
Posts: 3825
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Question about marco

Post by mol »

I've made some test and it works good to me.
I've closed parameter with " characters for sure:

Code: Select all

	cParam := '"' + GetDesktopFolder()+'\' + cFile +'"'
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?
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: Question about marco

Post by huangchenmin »

mol wrote:I've made some test and it works good to me.
I've closed parameter with " characters for sure:

Code: Select all

	cParam := '"' + GetDesktopFolder()+'\' + cFile +'"'
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?
Mine either.
I will try again later.
Best Regards
chen min
Post Reply