[Lazarus] Environment variables in IDE's search path
Mattias Gaertner
nc-gaertnma at netcologne.de
Sun May 17 14:05:32 CEST 2009
On Sun, 17 May 2009 13:46:38 +0200
tiziano de togni <tiziano.detogni at gmail.com> wrote:
> Mattias Gaertner ha scritto:
> > On Sat, 16 May 2009 17:58:12 +0200
> > tiziano de togni <tiziano.detogni at gmail.com> wrote:
> >
> >>> I added a macro function $Env(name).
> >>>
> >> Fine! Is it possible to add also a macro function $BatchExt()
> >> ('.bat' in windows, '.sh' on linus, no idea on Mac)?
> >
> > Can you give an example for this macro?
> >
> Well, after compiling a project I need to execute a batch file on
> windows and a shell script on Linux. Using the Execute After Command
> of the IDE.
>
> In my project folder I keep a .bat file and an equivalent .sh file,
> but every time I compile on one side I have to change the .bat to .sh
> and viceversa, so a macro of this kind could solve this problem using
> the command test$BatchExt().
>
> Indeed, I just found a trick that solves my problem.
>
> Using the command: test$TargetOS().cmd the IDE executes the script
> testlinux.cmd or testwin32.cmd for the respective platform.
>
> So, the macro I asked for is not really so useful...
You can not execute a bash script directly. You must execute the shell
and pass the script as parameter. A simple test.$BatchExt() would not
work.
Do you have another example?
Mattias
More information about the Lazarus
mailing list