Recent

Author Topic: Environment Variables  (Read 9268 times)

Sagrer

  • Newbie
  • Posts: 4
Environment Variables
« on: May 07, 2007, 07:48:57 pm »
Hi all.

Is it any vay to access system's environment variables?
For example i declare a variable "KolPath=I:\UserApps\libs\KOL" (in MyComputer's properties - WindowsXP) and than i try to add "$(KolPath)\" in a compiler's options for "-Fu" option (Another modules) - to make a KOL library's modules visible for a compiler...
As i see - lazarus 0.9.22 can't understand what is ""$(KolPath)"

This library is separate from an application's source, and i don't want to add a library into application's source directory (to acces it by relative paths)... application is developed by more than 1 developers - and "I:\UserApps\libs\KOL" - may be different for everybody....

In Delphi - this all can be configured independently of project's files - in Delphi's environment options - by adding absolute paths there.

In Lazarus absolute paths also can be used, but there are saves into project's files and as ve use SVN repository - when anybody changed this path - it'll be sended to SVN by he's next commit :(.

Any advices?

Wanagen

  • New Member
  • *
  • Posts: 30
RE: Environment Variables
« Reply #1 on: May 08, 2007, 12:48:46 am »
Hi,
i think the best way is to create a component for your environement variables
with procedures and functions to test if "kolpath" exist in system environement,
retreive the path and define KolPath in lazarus environement.

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
RE: Environment Variables
« Reply #2 on: May 10, 2007, 11:26:51 am »
Go to project/project inspector/options/session, and tick in "save in .lps file in project directory"

This way all the user-specific stuff like paths will be saved in a separate .lps file, not in the .lpi one. Don't commit the .lps and you're fine.

 

TinyPortal © 2005-2018