I am trying to get the Novell username from the environment variable U. 
However I am getting an access violation
appearing with the following code:

        var
          sUserName: String;

        begin
          SetLength(sUserName, 9);
          GetEnvironmentVariable(PChar('u'), PChar(sUserName), 9);
        end;  <----- The IDE shows this line as the point of the access
violation.

If I use 'username' to get the NT username the code works perfectly. 
However I am the only one running NT so I
need the Novell username.

Can anyone tell me why this does not work or point me at a better way to
get the Novell username?

-- 
Glen Boyd               <[EMAIL PROTECTED]>
Programmer              Napier City Council
Private Bag 6010, Napier, NEW ZEALAND
Phone: +64-6-8357579    Fax: +64-6-8357574
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to