Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Borland > Re: unknown ide...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 7 Topic 1070 of 1118
Post > Topic >>

Re: unknown identifier

by Joe <joe@[EMAIL PROTECTED] > Feb 5, 2008 at 12:09 PM

Dave R. wrote:
> "Joe" <joe@[EMAIL PROTECTED]
> wrote in message 
> news:13mod69bok30h86@[EMAIL PROTECTED]
>> Dave R. wrote:
>>> "Joe" <joe@[EMAIL PROTECTED]
> wrote in message 
>>> news:13mnjamps7fpn19@[EMAIL PROTECTED]
>>>> I keep tring to shell out of my program to run a small utility 
>>>> program. I use Exec. and I keep getting the same error, Unknown 
>>>> Identifier. That I don't under stand. That command or option in 
>>>> listed in the help files.
>>>>
>>>>
>>>> Exec ('CMD.EXE /C ' + myutil.exe);
>>> The declaration for Exec is:
>>>
>>> procedure Exec(Path, CmdLine: string);
>>>
>>> So the compiler is treating myutil.exe as a variable name / 
>>> identifier, but since it hasn't been declared as one the compiler 
>>> throws an error. You probably need something like:
>>>
>>> Exec(GetEnv('COMSPEC'), '/C myutil.exe);
>>>
>>> GetEnv('COMSPEC') will return the full path to the command 
>>> interpreter, and the '/C myutil.exe' will complete the command line 
>>> you need.
>>>
>>> Hope this helps!
>>>
>>>
>> Thanks Dave, But, No. I'm sorry, It doesn't, See I real new to Pascal. 
>> Just over a month, Any way if you have time. This is how I tried to 
>> run it.
>>
>> Exec('CMD.EXE /C ' + util + ' i' + ParamStr(0) + 'work\addata.dat' + 
>> forsale + ' ' + ParamStr(0) + 'work\userdata.dat');
>>
>> util:= 'path\filename'; // The utils program it self, In a Variable
>>
>> addata:=  Command line option for Util
>> userdata:= Command line option for util
>>
> 
> It looks like another poster has pointed you in the right direction, but

> if not (or if his post didn't make it to you):
> 
> Exec takes two parameters, and in Turbo Pascal parameters must be 
> separated by a comma, so the 1st example you posted needed to be 
> something like (without my adjustment to get comspec to make the 
> application more universal, and with the final ' that I missed):
> 
> Exec ('CMD.EXE' , '/C ' + 'myutil.exe');
> 
> And here's your original for comparison:
> 
> Exec ('CMD.EXE /C ' + myutil.exe);
> 
> Note the subtle but im****tant differences.
> 
> Your newer, more complex example would become:
> 
> Exec('CMD.EXE' , '/C ' + util + ' i' + ParamStr(0) + 'work\addata.dat' +

> forsale + ' ' + ParamStr(0) + 'work\userdata.dat');
> 
> Assuming of course that util (as you've already indicated) and forsale 
> are properly declared.  It also looks like you may need a space at the 
> end of 'work\addata.dat' depending on how the util program takes 
> parameters.
> 
> Regards,
> 
> Dave
> 
> 
> 
> 
Thanks Dave that doesn't work as well, Every time I try and compile. 
Just after the var forsale + ' '
where the + sign is it keeps telling me that a error 88 "(" is exspected
Right now I'm thinking that this isn't going to work.
 




 7 Posts in Topic:
unknown identifier
Joe <joe@[EMAIL PROTEC  2007-12-21 09:18:27 
Re: unknown identifier
"Dave R." <d  2007-12-21 09:42:25 
Re: unknown identifier
Joe <joe@[EMAIL PROTEC  2007-12-21 16:39:37 
Re: unknown identifier
Robert Riebisch <Rober  2007-12-22 21:05:42 
Re: unknown identifier
"Dave R." <d  2007-12-27 16:02:48 
Re: unknown identifier
Joe <joe@[EMAIL PROTEC  2008-02-05 12:09:28 
Re: unknown identifier
"Sv. Broholm" &  2008-02-06 12:34:39 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 23 15:48:16 CDT 2008.