Class/Static Constants in Delphi

前端 未结 9 746
粉色の甜心
粉色の甜心 2021-02-05 12:06

In Delphi, I want to be able to create an private object that\'s associated with a class, and access it from all instances of that class. In Java, I\'d use:

pub         


        
9条回答
  •  终归单人心
    2021-02-05 12:29

    Before version 7, Delphi didn't have static variables, you'd have to use a global variable.

    To make it as private as possible, put it in the implementation section of your unit.

提交回复
热议问题