Changeset 103 for trunk/NewView/StartupUnit.pas
- Timestamp:
- Mar 26, 2007, 8:35:37 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NewView/StartupUnit.pas
r82 r103 25 25 // Look for any items that are actually specifiying environment 26 26 // variables, and expand them to the contents of the variables 27 Procedure TranslateIPFEnvironmentVars( Items: TStrings; 28 ExpandedItems: TStrings ); 27 Procedure TranslateIPFEnvironmentVars(const Items: TStrings; ExpandedItems: TStrings ); 29 28 30 29 // Given a filename, which may or may not contain a path or extension, … … 47 46 DebugUnit, 48 47 PMWin, 49 ACLStringUtility,50 48 HelpManagerUnit, 49 StringUtilsUnit, 51 50 FileUtilsUnit; 52 51 53 52 // Look for any items that are actually specifiying environment 54 53 // variables, and expand them to the contents of the variables 55 Procedure TranslateIPFEnvironmentVars( Items: TStrings; 56 ExpandedItems: TStrings ); 54 Procedure TranslateIPFEnvironmentVars(const Items: TStrings; ExpandedItems: TStrings ); 57 55 var 58 i : longint;59 Item: string;60 EnvironmentVarValue: string;56 i : longint; 57 tmpItem: string; 58 tmpEnvironmentVarValue: string; 61 59 begin 62 60 LogEvent(LogStartup, 'Translating environment vars' ); 63 61 for i := 0 to Items.Count - 1 do 64 62 begin 65 Item := Items[ i ];63 tmpItem := Items[ i ]; 66 64 67 Item := StrUnQuote( Item); // remove single quotes68 Item := StrUnDoubleQuote( Item); // remove double quotes65 tmpItem := StrTrimChars(tmpItem, [Quote]); // remove single quotes 66 tmpItem := StrTrimChars(tmpItem, [DoubleQuote]); // remove double quotes 69 67 70 LogEvent(LogStartup, ' Item: ' +Item );71 EnvironmentVarValue := GetEnv( Uppercase(Item ) );68 LogEvent(LogStartup, ' Checking for environment var: ' + tmpItem ); 69 tmpEnvironmentVarValue := GetEnv( Uppercase( tmpItem ) ); 72 70 if DosError = 0 then 73 71 begin 74 72 // environment var exists - use it's value 75 LogEvent(LogStartup, ' Translated: ' + EnvironmentVarValue ); 76 while EnvironmentVarValue <> '' do 77 begin 78 Item := ExtractNextValue( EnvironmentVarValue, '+' ); 79 ExpandedItems.Add( Item ); 80 end; 73 LogEvent(LogStartup, ' Environment var found; translated to: ' + tmpEnvironmentVarValue); 74 StrExtractStrings(ExpandedItems, tmpEnvironmentVarValue, ['+'], #0); 81 75 end 82 76 else 83 77 begin 84 78 // not an environment var 85 ExpandedItems.Add( Item );79 ExpandedItems.Add( tmpItem ); 86 80 end; 87 81 end;
Note:
See TracChangeset
for help on using the changeset viewer.