How to Read dos environment variables?



How to Read dos environment variables?..

Answer / Ajit Singh

To read DOS environment variables in Delphi, you can use the GetEnvironmentVariable function. Here's an example:nn```delphinfunction GetDosEnvVar(const VarName: string: string): string;nbeginn result := '';n var Len := Length(PChar(VarName)) + SizeOf(VarName);n if GetEnvironmentVariable(PChar(VarName), @Len, PChar(Result)) thenn SetLength(Result, Len)n end;nend;n``

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Delphi Interview Questions

How to Change the default width/height of the editor?

0 Answers  


How to Get the printing margin of the page?

1 Answers  


How to use the Lookup method to return values from multiple columns ?

1 Answers  


How to Get the Windows version in code?

1 Answers  


How to Create a Lookup field at runtime ?

1 Answers  


What is the function of inheritance in delphi?

1 Answers  


I'm using Delphi 4/5 and have am trying to fill a RichEdit control with both European characters and Thai characters - while I can change character colours the font stays with what was selected for the control:- reLangB.SelAttributes.Color :=dCol; reLangB.SelAttributes.Name :=FontName[dLang]; reLangB.SelAttributes.Charset :=FontChar[dLang]; reLangB.SelAttributes.Style :=[]; reLangB.Lines.Add(dText); The FontName and FontChar arrays contain the font info, and using a similar method for Captions and EditBoexes works! Anybody any ideas? Thanx in advance!

1 Answers  


How to generate an error for SELECT statements that divide by zero?

1 Answers  


What is the diff between IT Company & other companies?.

1 Answers   IBM,


How to Change the owner of a component at runtime ?

0 Answers  


what are Multiple Transports?

1 Answers  


How to custom draw menu items?

1 Answers  


Categories