Class variables basically means that you can define a variable (or multiple variables) in a class that can be altered regardless of an instance construction. This is a handy technique for setting conditions before an object is created from the class prototype.


TMyClass = Class(TObject)

Public

 class var driverMode: Int32;

End;


TMyClass.driverMode := 1200;


Class variables are wonderful, especially when writing wrapper code around existing JavaScript libraries or frameworks. For example, if a library has already been loaded - you can use a class variable to reflect that, so you don't end up trying to load the same framework twice. In the QTX RTL class variables are used abundantly.