home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,578 of 2,978   
   "Dave R."    
   Re: unknown identifier   
   21 Dec 07 09:42:25   
   
   "Joe"  wrote in message   
   news:13mnjamps7fpn19@corp.supernews.com...   
   >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!   
      
   Dave   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca