in the child class, i wish different constants, with the possibility of having Many child objects
i'm looking to offload text to parent in the interest of less typing / rapid prototyping but the definitions use the child constants
here's example
Code: Select all
type tRNG_Parent
as long state, invMul_
' use child-defined constants.
declare operator cast as ulong
declare function f(as long=0)as ulong
declare function r(as long=0)as ulong
declare constructor
End Type
'' use child-defined constants
function tRNG_Parent.f(i as long) as ulong
asm ror dword ptr [i], ro
state = (i + add_) * mul_
return state
End function
function tRNG_Parent.r(i as long) as ulong
i = (i * invmul_ - add_)
asm rol dword ptr [i], ro
state = i: return i
End function
operator tRNG_parent.cast as ulong
return f(state)
End Operator
type tRNG extends tRNG_Parent
const ro = 30
const mul_ = 3
const add_ = 1
End Type