program UserName;
uses PXEngine, WinCrt;

var   PxErr: Integer;
      UserNamevar: array[0..24] of char;

procedure PX(Code : integer);
begin
  writeln(PXErrMsg(Code));
end;

begin
  PX(PXWinInit('MyApp', pxShared));

  (* Get network user name *)
  PxErr := PXNetUserName(25, @UserNameVar);
  if PxErr <> PxSuccess then
    Writeln(PxErrMsg(PxErr))
  else Writeln('My user name is ', UserNameVar);

  PX(PXExit);
end.

