How do I find out which version of the OS is running?

A: With the OS version identifier.

Stuart Halliday replied to a request to find out the OS version identifier... Use something like this:

SYS"OS_Byte",129,0,&FF TO ,O%
CASE O% OF
 WHEN &A0 : OS%=120
 WHEN &A1 : OS%=200
 WHEN &A2 : OS%=201
 WHEN &A3 : OS%=300
 WHEN &A4 : OS%=311
 WHEN &A5 : OS%=350
 WHEN &A6 : OS%=360
 WHEN &A7 : OS%=370
 WHEN &A8 : OS%=400
OTHERWISE
 OS%=0
ENDCASE
OSCLI("Set RiscOS$Version"+STR$(OS%))

David Holden, A.P.D.L. also pointed out that:
Wimp_Initialise doesn't return the OS version, but returns the version of the Wimp × 100, and this may be different. For example, an OS 3.7 machine with the 'New Boot' structure, soft loading the nested wimp, will return 385 (well, mine does). My version of RO4 returns 415, though I don't know if production versions will have this number. You can't rely on these numbers being constant because, even on older machines, 'patches' can update them. They should only be used to check for minimum functionality, e.g. if it's less than 350 it's not a RiscPC architecture machine, if it's less than 370 it can't be a StrongARM, if it's less than 380 it can't be running the nested wimp.


Source: Archive Magazine - 13.1 - "Hints and Tips"
Publication: Archive Magazine
Contributors: Stuart Halliday , Dave Holden