RosettaCodeData/Task/Hostname/Liberty-BASIC/hostname.liberty
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

8 lines
262 B
Text

lpBuffer$=Space$(128) + Chr$(0)
struct SIZE,sz As Long
SIZE.sz.struct=Len(lpBuffer$)
calldll #kernel32, "GetComputerNameA",lpBuffer$ as ptr, SIZE as struct, result as Long
CurrentComputerName$=Trim$(Left$(lpBuffer$, SIZE.sz.struct))
print CurrentComputerName$