records333
Technical User
I inherited a report and I'm learning about variable. I would like assistance of interpreting and recommendations on how to refine:
Extending code that uses a string fieldglobal stringvar a1cvalue := {table.LAST_VALUE};
if mid ({table.LAST_VALUE},4,1) = "-"
then a1cvalue := mid({table.LAST_VALUE},1,3)
else
if mid ({table.LAST_VALUE},5,1) = "-"
then a1cvalue := mid({table.LAST_VALUE},1,4)
else
if mid ({table.LAST_VALUE},3,1) = "-"
then a1cvalue := mid({table.LAST_VALUE},1,2)
else
if mid ({table.LAST_VALUE},2,1) = "-"
then a1cvalue := mid({table.LAST_VALUE},1,1)
else
a1cvalue := "?Val";
I would like to refine the above using a field that is a number vs. a string.
Extending code that uses a string fieldglobal stringvar a1cvalue := {table.LAST_VALUE};
if mid ({table.LAST_VALUE},4,1) = "-"
then a1cvalue := mid({table.LAST_VALUE},1,3)
else
if mid ({table.LAST_VALUE},5,1) = "-"
then a1cvalue := mid({table.LAST_VALUE},1,4)
else
if mid ({table.LAST_VALUE},3,1) = "-"
then a1cvalue := mid({table.LAST_VALUE},1,2)
else
if mid ({table.LAST_VALUE},2,1) = "-"
then a1cvalue := mid({table.LAST_VALUE},1,1)
else
a1cvalue := "?Val";
I would like to refine the above using a field that is a number vs. a string.