Announcement

Collapse
No announcement yet.

Setting enviroment variable

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Setting enviroment variable

    Hallo,

    is it posible in power basic to set a enviroment variable so that i can use the enviroment variable when the programm has finished.
    I need this for DOS.
    I wanne make a programm that writes information in a enviroment variable and a batch file checks the enviroment variable !

    Sorry about my English

    Thanks
    Christian

    ------------------

  • #2
    Check out ENVIRON$ in the help file.
    I don't know if you can set the environment with this but you
    read it and write the results to a .TXT file.



    ------------------
    There are no atheists in a fox hole or the morning of a math test.
    If my flag offends you, I'll help you pack.

    Comment


    • #3
      This works only for the child prozess. That means the changes are only for the time when the programm runs. after the programms end, the changes oder the new enviroment variables are deletet or unchanged.


      ------------------

      Comment


      • #4
        It's possible but, you'll need to do some research. See the ENVIRON.FAQ file
        in your PB/DOS FAQ directory.


        ------------------
        Tom Hanlin
        PowerBASIC Staff

        Comment


        • #5
          Optionally, you could skip using the batch file (unless it's
          Autoexec.bat) and use PowerBASIC entirely.

          That is of course to be determined by you. I have seen
          utilities that modify the master copy of the environment and I
          used to have a book that mentioned how to do so in QBasic calles
          MS-DOS Batch Files Inside and Out. I have since lost the book.


          ------------------
          Amos
          mailto:[email protected][email protected]</A>

          Comment


          • #6
            I get in the next minutes, hours, days a programm that copies the child environment over the master environment.
            That is not the way that Iám looking for. Im looking for a way do change the master environment in a Basic Programm.

            Christian

            ------------------

            Comment

            Working...
            X