A partir da versão 17.3.0.0, métodos estáticos estão disponíveis para TL++TLPP / PRW.
Métodos estáticos são por padrão públicos.
Bloco de código
language
cpp
firstline
1
title
MetodoEstatico.tlpp
linenumbers
true
#include "protheus.ch"
class StaticMethod
method new()
static method staticExample()
method teste2()
data dataI
endclass
method new() class ForWithProperty
return self
method staticExample() class StaticMethod
conout("exemplo")
/* conout(::dataI) //C9904 Cannot access data nor methods of class from a static method */
/* conout(::teste2()) //C9904 Cannot access data nor methods of class from a static method */
return
method teste2() class StaticMethod
return
main function tteci_142
StaticMethod():staticExample()
return