The only external dependency to the Quartex runtime library so far, has been platform.js. This is a tiny library that provides in-depth info about the browser. Things like operating system, version, the browser type and other useful tidbits. Well, that dependency is no more since we now have our own, pascal only version in the RTL!
Same interface
Since we want as much as possible to be the same between NodeJS and DOM projects from an RTL point of view -we now have a simple base-class called TQTXPlatform in the unit qtx.platform.pas (system package).
We then have TQTXPlatformDOM in qtx.dom.platform.pas (DOM package) which inherits from TQTXPlatform. And likewise, TQTXPlatformNode in qtx.node.platform.pas within the NODE package.

So depending on project type, you include either qtx.dom.platform or qtx.node.platform to your uses clause if you need info about the runtime environment.
Properties
The following properties are exposed uniformly:
- Runtime: TQTXRuntime
- Version: TQTXPlatformVersion
- OSType: TQTXPlatformType
- OSArchitecture: TQTXArchitecture
- Product: string
- Manufacturer: string
- Description: string
The ‘OSType’ enum is perhaps the most useful besides ‘Runtime’, and provides the operating system you are running on (as far as it can be detected). The following systems are checked for:
- pmUnknown (returned if no OS can be recognized at all)
- pmAmiga
- pmWindows
- pmLinux
- pmUnix
- pmMac
- pmiOS
- pmChromeOS
- pmAndroid
- pmEmbedded
- pmWindowsPhone
- pmXBox
- pmPlaystation
- pmNintendoSwitch
While Mac is technically a Unix system, it made sense to separate it from systems like FreeBSD, OpenBSD or IBM AiX. We also included the 3 most prominent gaming platforms (XBox, PS and Nintendo) since these have browser capability.
How to use?
The baseclass (TQTXPlatform) has a class property that is initialized depending on what unit you have included. So for a DOM project you will naturally add “qtx.dom.platform” to your uses clause. You can then access the instance like this:
TQTXPlatform.Current.[property]
For example:
writeln( TQTXPlatform.Current.Description );
Changes to the RTL
There were a couple of places in our code that we had lose functions for doing similar things earlier (which called platform.js). These are now obsolete and everything in the RTL that needs to check things like browser type etc – now uses the platform system.
Just be aware of this if you recompile any code that uses the older functions.
The code will be in the next RTL update!