Ignore:
Timestamp:
Jun 1, 2009, 2:42:16 PM (16 years ago)
Author:
RBRi
Message:

index is a real object now
support for env variables to make glossary simulation work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NewView/StartupUnit.pas

    r259 r342  
    1919const
    2020  OWN_HELP_MARKER = '[NVHELP]';
    21   HELP_FILE_DELIMITER = '+';
    2221
    2322
     
    2625// Look for any items that are actually specifiying environment
    2726// variables, and expand them to the contents of the variables
    28 Procedure TranslateIPFEnvironmentVars(const Items: TStrings; ExpandedItems: TStrings );
    2927
    3028// Given a filename, which may or may not contain a path or extension,
     
    5149  FileUtilsUnit;
    5250
    53 // Look for any items that are actually specifiying environment
    54 // variables, and expand them to the contents of the variables
    55 Procedure TranslateIPFEnvironmentVars(const Items: TStrings; ExpandedItems: TStrings );
    56 var
    57   i : longint;
    58   tmpItem: string;
    59   tmpEnvironmentVarValue: string;
    60 begin
    61   LogEvent(LogStartup, 'Translating environment vars' );
    62   for i := 0 to Items.Count - 1 do
    63   begin
    64     tmpItem := Items[i];
    65 
    66     tmpItem := StrTrimChars(tmpItem, [StrSingleQuote]); // remove single quotes
    67     tmpItem := StrTrimChars(tmpItem, [StrDoubleQuote]); // remove double quotes
    68 
    69     LogEvent(LogStartup, '  Checking for environment var: ' + tmpItem );
    70     tmpEnvironmentVarValue := GetEnv( Uppercase( tmpItem ) );
    71     if DosError = 0 then
    72     begin
    73       // environment var exists - use it's value
    74       LogEvent(LogStartup, '    Environment var found; translated to: ' + tmpEnvironmentVarValue);
    75       StrExtractStrings(ExpandedItems, tmpEnvironmentVarValue, [HELP_FILE_DELIMITER], #0);
    76     end
    77     else
    78     begin
    79       // not an environment var
    80       ExpandedItems.Add(tmpItem);
    81     end;
    82   end;
    83 end;
    8451
    8552// Given a filename, which may or may not contain a path or extension,
Note: See TracChangeset for help on using the changeset viewer.