I have been trying to change between numerical formats at runtime (On load for a form really).
In the On Load event for the form I have the following code:
: (<>Country=“United Kingdom”)
OBJECT SET FORMAT(*;“Balance_Col”;"|Pounds")
: (<>Country="Spain") OBJECT SET FORMAT(*;"Balance_Col";"|Euros") Else OBJECT SET FORMAT(*;"Balance_Col";"|Dollars")
Which does not seem to have any effect. I have added the following code to try and get more information about what is going on:
$vP_BalCol:=OBJECT Get pointer(Object named;“Balance_Col”)
$vT_tmp:=OBJECT Get format(*;“Balance_Col”)
The $vP_BalCol variable is always Nil, and the $vT_tmp var is always empty.
I can sort of work around it by replacing the data source expression with String(This.Balance;Form.balance_format) but that will break the default sort behaviour for the column but I would like to avoid reproducing the default sort behaviour manually.
Does anyone know why this (OBJECT Set Format not changing) might be happening?