Getting some System Info in Xojo 2013r1?

Hi,

I have some code that I wrote that gets some of the system info which works in the recent versions of Xojo (I’m using the latest mostly).

The following is clipped out of my working code on the latest Xojo release (2023r2).

var systeminfo as new SysInfo


lbl_bit.text=Systeminfo.BitSize
lbl_cputype.text=Systeminfo.CPUType
lbl_OS.text=Systeminfo.OSVer

Getting errors saying there is no class with this name for SysInfo so I don’t think it’s finding Systeminfo in 2013r1. Is there an equivalent class I can use? Or is there another method I should be using to get some of that basic info?

While it’s not critical, I’m just trying to see if I can compile for older 32bit MacOS.

Thanks!

Not sure as I do not mainly build and support for macOS but would using the newest IDE be problematic?
I mean did not Apple drop support for x32 some time ago?

You can get two of those items from compiler constants:

Bitness
Target32Bit and Target64Bit

Processor
TargetARM and TargetX86

https://documentation.xojo.com/api/compiler_directives/if...endif.html

You can use a shell to execute this command to get the system version:

uname -r

1 Like

Use the built-in Language Reference (to be set in Preferences: search Use Local LR or so) will greatly help you with this kind of things…

1 Like

SysInfo isn’t a framework class, so perhaps you just need to bring the class from your larger project. Another sign that it’s not built in is that Xojo uses verbose names now, “OSVer” would never fly in API 2.0.

3 Likes

As Tim said ‘SysInfo’ is not part of Xojo (2023r2), this is what I get using your code:
image

I guess that is the same as you get with 2013r1.

Search your project for SysInfo.

Tim, you are correct. I had completely forget that I created the class SysInfo elsewhere in the code. I’m still getting comfortable with creating classes. I was able to add my class to the new project and it seems to be working. Thanks!