It is currently Tue Nov 12, 2019 10:07 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: ComputerName() returns ComputerName.Router
PostPosted: Fri May 17, 2019 7:16 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Jun 11, 2004 7:07 am
Posts: 600
In my case ComputerName() returns "MacBook.local" on work and "MacBook.Speedport_Router_xyz" at home.

Is this a bug or an undocumented feature?


Top
 Profile  
Reply with quote  
 Post subject: Re: ComputerName() returns ComputerName.Router
PostPosted: Fri May 17, 2019 10:06 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Dec 29, 2011 5:03 pm
Posts: 498
I don't know about PureBasic's function, but you can get a better version like this:
Code:
host = CocoaMessage(0, 0, "NSHost currentHost")

hostName = CocoaMessage(0, host, "name")
string = CocoaMessage(0, hostName, "UTF8String")
Debug PeekS(string, -1, #PB_UTF8)

localisedName = CocoaMessage(0, host, "localizedName")
string = CocoaMessage(0, localisedName, "UTF8String")
Debug PeekS(string, -1, #PB_UTF8)

Debug ComputerName()


Top
 Profile  
Reply with quote  
 Post subject: Re: ComputerName() returns ComputerName.Router
PostPosted: Sat May 18, 2019 1:05 am 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 2020
Location: Germany
Thanks

The Purebasic version returns the wrong machine name when virtual machines are running.

_________________
My Projects ThreadToGUI / OOP-BaseClass / OOP-BaseClassDispatch / EventDesigner V3
PB v3.30 / v5.70 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye