function pcname:string; var ComputerName: array[0..MAX_COMPUTERNAME_LENGTH+1] of char; Size: cardinal; re:string; begin Size := MAX_COMPUTERNAME_LENGTH+1; if GetComputerName(ComputerName, Size) then re:=StrPas(Computername) else re := ''; result:=re; end;