[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Function:    SetEnv()

               This function is the logical complement of the
               GetEnv() (and ReadEnv()) functions, as it allows
               the user to adapt some environmental variable.
               Any changes made to the environment will not be
               reflected in the application's current environment,
               so they will not be visible with Clipper's GetEnv().
               ReadEnv(), however, reads from the ORIGINAL copy
               of the environment strings, and thus correctly
               shows the eventual changes made.

               Settings done with SetEnv() will be visible for
               applications started with Clipper's RUN command,
               but also when the application QUITs, so do restore
               the original Variables when done.

  Syntax:      SetEnv(cVar,cValue)

  Arguments:   <cVar> is the variable one wishes to change/create,
               <cValue> is the value to set. If <cVar> exists, it
               is replaced.

  Returns:     A logical indicating the succes of the operation.
               SetEnv() fails (and returns .f.) when there is not
               enough room to hold the new string. It is not added
               in that case, and the eventual exisiting <cVar> is not
               removed.


  Usage:       SetEnv('PROMPT','(Shell) '+GetEnv('PROMPT'))
               x = EnvPtr(EnvOrig())
               RUN WhatEver
               EnvPtr(x)
               setEnv('PROMPT',GetEnv('PROMPT'))
               * - GetEnv() still holds the old Prompt setting....
               *   So this construction works
               *   (it doesn't if GetEnv() is replaced with ReadEnv()!)
               * EnvPtr() sets the Env. Pointer to the original Block.
               * EnvOrig() returns a Pointer to the orig block.
               * x si used to restore the Clipper environment strings.

See Also: ReadEnv() EnvPtr() EnvOrig()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson