Answered Logical To String Conversion With Format Using Buffer-field

davidvilla

Member
Hi, I am trying to dynamically convert a logical value to string with a specific format. It works fine, but the TRUE value is not getting displayed properly. See example below.

Code:
define variable httOutData      as handle    no-undo.
define variable bhttOutData     as handle    no-undo.

create temp-table httOutData.
httOutData:add-new-field("mylogfield","character",0,"ACTIVE/INACTIVE",?,"","ACTIVE-FLAG").
httOutData:temp-table-prepare("httOutData").
bhttOutData = httOutData:default-buffer-handle.

for each tablename no-lock:
bhttOutData:buffer-create().
bhttOutData:buffer-field(1):buffer-value =  string(tablename.logfield,bhttOutData:buffer-field(1):format).

disp bhttOutData:buffer-field(1):buffer-value tablename.logfield .

end.

In this code, the value for yes is displayed as "A" (instead of "ACTIVE"). This is my problem. I tried replacing "ACTIVE" in the format with some other text and got weird results.

Why does this happen? How do I fix this?

I am using OE11.5 with HP-UX environment.
 
Top