Re: input array of decimal numbers, with A4GL_NUMERIC set to comma, values are multiplied by 100

Øyvind Gjerstad <[email protected]>
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <[email protected]>
Some new findings: the values are not always multiplied by 100, but the 
number of decimal spaces in the declaration is used and appended to the 
value, so for a decimal(10,2) the value is effectively multiplied by 
100, for decimal(10,3) it is multiplied by 1000, and so on.

With A4GL_NUMERIC set to comma (","), there is some confusion internally 
in aubit4gl library. If I input "1", it is converted to "00000001.00" (a 
string in posix format, in decimal.c, A4GL_str_to_dec), and later when 
it is to be converted into a decimal value (in ioform.c?) , the decimal 
separator from A4GL_NUMERIC is used, so this value becomes "100,0" .

Apparently this only happens in input array, strangely enough.

I am not capable of determining what is really needed, or where the fix 
should be applied.

Looks like it passes through these functions several times. The value 
input here is "1".

decimal.c            229    dbg (     0,     0,0) 
A4GL_decstr_convert      ()  Converting "1" ,N->.N
decimal.c            478    dbg (     0,     0,0) 
A4GL_decstr_convert      ()  Conversion result"1"
decimal.c            558    dbg (     0,     0,0) 
A4GL_str_to_dec          ()  XYXY str to dec : '1'
decimal.c            661    dbg (     0,     0,0) 
A4GL_str_to_dec          ()  digits=1 decimals=0
decimal.c            729    dbg (     0,     0,0) 
A4GL_str_to_dec          ()  head_len=1
decimal.c            730    dbg (     0,     0,0) 
A4GL_str_to_dec          ()  head_i=1 head='1'
decimal.c            749    dbg (     0,     0,0) 
A4GL_str_to_dec          ()  head2=1
decimal.c            769    dbg (     0,     0,0) 
A4GL_str_to_dec          ()  ----> 1.
builtin_d.c          298    dbg (     0,     0,0) 
A4GL_push_dec            ()  push_dec with size=100
mem.c                171    dbg (     0,     0,0) 
acl_free_full            ()  Free 0x22b21d0 stack.c 5022
iarray.c             3608   dbg (     0,     0,0) 
process_control_stack_internal()  Calling pop_iarr_var
iarray.c             574    dbg (     0,     0,0) 
pop_iarr_var             ()  In pop_iarr_var 0 1 currentfield=0x22af6e0
ioform.c             4317   dbg (     0,     0,0) 
A4GL_copy_field_data     ()  form->currentfield=0x22af6e0
ioform.c             4323   dbg (     0,     0,0) 
A4GL_copy_field_data     ()  Is a proper field
ioform.c             4327   dbg (     0,     0,0) 
A4GL_copy_field_data     ()  fprop=0x22ad8c0
ioform.c             4332   dbg (     0,     0,0) 
A4GL_copy_field_data     ()  check Datatype
ioform.c             4337   dbg (     0,     0,0) 
A4GL_copy_field_data     ()  modify size dtype
ioform.c             1462   dbg (     0,     0,0) 
A4GL_get_metric_for      ()  In curr metric
ioform.c             1469   dbg (     0,     0,0) 
A4GL_get_metric_for      ()  Returning 10
ioform.c             4338   dbg (     0,     0,0) 
A4GL_copy_field_data     ()  modfy size for metric 10
ioform.c             1462   dbg (     0,     0,0) 
A4GL_get_metric_for      ()  In curr metric
ioform.c             1469   dbg (     0,     0,0) 
A4GL_get_metric_for      ()  Returning 10
ioform.c             4342   dbg (     0,     0,0) 
A4GL_copy_field_data     ()  modfy size done -> ''
ioform.c             4347   dbg (     0,     0,0) 
A4GL_copy_field_data     ()  copy 1
ioform.c             4351   dbg (     0,     0,0) 
A4GL_copy_field_data     ()  copy 2
ioform.c             4352   dbg (     0,     0,0) 
A4GL_copy_field_data     ()  trim buff
ioform.c             4358   dbg (     0,     0,0) 
A4GL_copy_field_data     ()  CHange y=8, x=9
ioform.c             4359   dbg (     0,     0,0) 
A4GL_copy_field_data     ()  stack manip buff2='1'
ioform.c             4364   dbg (     0,     0,0) 
A4GL_copy_field_data     ()  Pushing param 0x7fff8035eaf0
ioform.c             5498   dbg (     0,     0,0) 
A4GL_fld_data_ignore_format()  FLD_DATA_IGNORE_FORMAT : 1
ioform.c             5506   dbg (     0,     0,0) 
A4GL_fld_data_ignore_format()  Has format
ioform.c             5539   dbg (     0,     0,0) 
A4GL_fld_data_ignore_format()  COPY -> 1 instead
ioform.c             5700   dbg (     0,     0,0) 
A4GL_fld_data_ignore_format()  Returning : 1
ioform.c             5724   dbg (     0,     0,0) 
A4GL_check_and_copy_field_to_data_area()  Got fld_data as : 1
stack.c              1363   dbg (     0,     0,0) 
A4GL_push_param          ()  7 Defaulting size
stack.c              833    dbg (     0,     0,0) 
A4GL_char_pop_size       ()  A4GL_char_pop...
stack.c              954    dbg (     0,     0,0) 
A4GL_char_pop_size       ()  Looks like it was a string..'1'
stack.c              968    dbg (     0,     0,0) 
A4GL_char_pop_size       ()  a=1
stack.c              1040   dbg (     0,     0,0) 
A4GL_pop_param           ()  params[params_cnt].dtype=0 d=0
stack.c              1041   dbg (     0,     0,0) 
A4GL_pop_param           ()  MASKED params[params_cnt].dtype=0 d=0
stack.c              975    dbg (     0,     0,0) 
A4GL_char_pop_size       ()  A4GL_char_pop - returning '1' (not null)
stack.c              4760   dbg (     0,     0,0) 
A4GL_lrtrim              ()  new lrtrim
stack.c              4776   dbg (     0,     0,0) 
A4GL_lrtrim              ()  Trimmed :'1'
decimal.c            229    dbg (     0,     0,0) 
A4GL_decstr_convert      ()  Converting "1" ,N->.N
decimal.c            478    dbg (     0,     0,0) 
A4GL_decstr_convert      ()  Conversion result"1"
decimal.c            558    dbg (     0,     0,0) 
A4GL_str_to_dec          ()  XYXY str to dec : '1'
decimal.c            661    dbg (     0,     0,0) 
A4GL_str_to_dec          ()  digits=1 decimals=0
decimal.c            729    dbg (     0,     0,0) 
A4GL_str_to_dec          ()  head_len=1
decimal.c            730    dbg (     0,     0,0) 
A4GL_str_to_dec          ()  head_i=1 head='1'
decimal.c            749    dbg (     0,     0,0) 
A4GL_str_to_dec          ()  head2=1
decimal.c            769    dbg (     0,     0,0) 
A4GL_str_to_dec          ()  ----> 1.
builtin_d.c          298    dbg (     0,     0,0) 
A4GL_push_dec            ()  push_dec with size=100
mem.c                171    dbg (     0,     0,0) 
acl_free_full            ()  Free 0x22b21b0 stack.c 5022
stack.c              1040   dbg (     0,     0,0) 
A4GL_pop_param           ()  params[params_cnt].dtype=261 d=5
stack.c              1041   dbg (     0,     0,0) 
A4GL_pop_param           ()  MASKED params[params_cnt].dtype=5 d=5
decimal.c            796    dbg (     0,     0,0) 
A4GL_dec_to_str          ()  Decimal 1 0
decimal.c            797    dbg (     0,     0,0) 
A4GL_dec_to_str          ()  XYXY dec to str : 1.
decimal.c            802    dbg (     0,     0,0) 
A4GL_dec_to_str          ()  ptr=1.
decimal.c            826    dbg (     0,     0,0) 
A4GL_dec_to_str          ()  --->XYXY ' 1'
stack.c              4760   dbg (     0,     0,0) 
A4GL_lrtrim              ()  new lrtrim
stack.c              4776   dbg (     0,     0,0) 
A4GL_lrtrim              ()  Trimmed :'1'
decimal.c            558    dbg (     0,     0,0) 
A4GL_str_to_dec          ()  XYXY str to dec : '1'
decimal.c            661    dbg (     0,     0,0) 
A4GL_str_to_dec          ()  digits=10 decimals=3
decimal.c            729    dbg (     0,     0,0) 
A4GL_str_to_dec          ()  head_len=7
decimal.c            730    dbg (     0,     0,0) 
A4GL_str_to_dec          ()  head_i=1 head='1'
decimal.c            749    dbg (     0, 0,0) A4GL_str_to_dec          
()  head2=0000001
decimal.c            769    dbg (     0,     0,0) 
A4GL_str_to_dec          ()  ----> 0000001.000
mem.c                171    dbg (     0,     0,0) 
acl_free_full            ()  Free 0x22b2280 stack.c 1094
ioform.c             4376   dbg (     0,     0,0) 
A4GL_copy_field_data     ()  Pushing param 0x7fff80360a30 5
stack.c              1040   dbg (     0,     0,0) 
A4GL_pop_param           ()  params[params_cnt].dtype=5 d=0
stack.c              1041   dbg (     0,     0,0) 
A4GL_pop_param           ()  MASKED params[params_cnt].dtype=5 d=0
decimal.c            796    dbg (     0,     0,0) 
A4GL_dec_to_str          ()  Decimal 10 3
decimal.c            797    dbg (     0,     0,0) 
A4GL_dec_to_str          ()  XYXY dec to str : 0000001.000
decimal.c            802    dbg (     0,     0,0) 
A4GL_dec_to_str          ()  ptr=0000001.000
decimal.c            826    dbg (     0,     0,0) 
A4GL_dec_to_str          ()  --->XYXY '       1.000'
stack.c              4760   dbg (     0,     0,0) 
A4GL_lrtrim              ()  new lrtrim
stack.c              4776   dbg (     0,     0,0) 
A4GL_lrtrim              ()  Trimmed :'1.000'
conv.c               1999   dbg (     0,     0,0) 
A4GL_dectos              ()  dec_to_str -> '1.000'
funcs_d.c            370    dbg (     0,     0,0) 
A4GL_pad_string          ()  Padding to size 14 by adding 9 spaces
conv.c               2005   dbg (     0,     0,0) 
A4GL_dectos              ()  w = 1.000
newpanels.c          2447   dbg (     0,     0,0) 
A4GL_chkwin              ()  chkwin
newpanels.c          2491   dbg (     0,     0,0) 
A4GL_chkwin              ()  API_ui Was screen mode..
newpanels.c          1526   dbg (     0,     0,0) 
UILIB_A4GL_get_curr_form ()  currwinno=0
ioform.c             1462   dbg (     0,     0,0) 
A4GL_get_metric_for      ()  In curr metric
ioform.c             1469   dbg (     0,     0,0) 
A4GL_get_metric_for      ()  Returning 10
ioform.c             1681   dbg (     0,     0,0) 
A4GL_get_field_width_w   ()  mno=10 formdets=0x22a3a80 f=0x22af6e0
ioform.c             1462   dbg (     0,     0,0) 
A4GL_get_metric_for      ()  In curr metric
ioform.c             1469   dbg (     0,     0,0) 
A4GL_get_metric_for      ()  Returning 10
newpanels.c          2447   dbg (     0,     0,0) 
A4GL_chkwin              ()  chkwin
newpanels.c          2491   dbg (     0,     0,0) 
A4GL_chkwin              ()  API_ui Was screen mode..
newpanels.c          1526   dbg (     0,     0,0) 
UILIB_A4GL_get_curr_form ()  currwinno=0
ioform.c             1462   dbg (     0,     0,0) 
A4GL_get_metric_for      ()  In curr metric
oform.c             1469   dbg (     0,     0,0) 
A4GL_get_metric_for      ()  Returning 10
ioform.c             1681   dbg (     0,     0,0) 
A4GL_get_field_width_w   ()  mno=10 formdets=0x22a3a80 f=0x22af6e0
ioform.c             1462   dbg (     0,     0,0) 
A4GL_get_metric_for      ()  In curr metric
ioform.c             1469   dbg (     0,     0,0) 
A4GL_get_metric_for      ()  Returning 10
ioform.c             3521   dbg (     0,     0,0) 
A4GL_mja_set_field_buffer()  mja_set_field_buffer buff='1.000         ' 
buff2='1.000         ' (14,14)
newpanels.c          2447   dbg (     0,     0,0) 
A4GL_chkwin              ()  chkwin
newpanels.c          2491   dbg (     0,     0,0) 
A4GL_chkwin              ()  API_ui Was screen mode..
newpanels.c          1526   dbg (     0,     0,0) 
UILIB_A4GL_get_curr_form ()  currwinno=0
ioform.c             1462   dbg (     0,     0,0) 
A4GL_get_metric_for      ()  In curr metric
ioform.c             1469   dbg (     0,     0,0) 
A4GL_get_metric_for      ()  Returning 10
ioform.c             1681   dbg (     0,     0,0) 
A4GL_get_field_width_w   ()  mno=10 formdets=0x22a3a80 f=0x22af6e0
ioform.c             1462   dbg (     0,     0,0) 
A4GL_get_metric_for      ()  In curr metric
ioform.c             1469   dbg (     0,     0,0) 
A4GL_get_metric_for      ()  Returning 10
ioform.c             3542   dbg (     0,     0,0) 
A4GL_mja_set_field_buffer()  No padding required '1.000         '
newpanels.c          2447   dbg (     0,     0,0) 
A4GL_chkwin              ()  chkwin
newpanels.c          2491   dbg (     0,     0,0) 
A4GL_chkwin              ()  API_ui Was screen mode..
newpanels.c          1526   dbg (     0,     0,0) 
UILIB_A4GL_get_curr_form ()  currwinno=0
ioform.c             1462   dbg (     0,     0,0) 
A4GL_get_metric_for      ()  In curr metric
ioform.c             1469   dbg (     0,     0,0) 
A4GL_get_metric_for      ()  Returning 10
ioform.c             1681   dbg (     0,     0,0) 
A4GL_get_field_width_w   ()  mno=10 formdets=0x22a3a80 f=0x22af6e0
ioform.c             1462   dbg (     0,     0,0) 
A4GL_get_metric_for      ()  In curr metric
ioform.c             1469   dbg (     0,     0,0) 
A4GL_get_metric_for      ()  Returning 10
ioform.c             3565   dbg (     0,     0,0) 
A4GL_mja_set_field_buffer()  setting field buffer to 1.000 .. 14
curslib.c            2393   dbg (     0,     0,0) 
local_field_opts         ()  UUU GOT 0x22af6e0 20f
ioform.c             4162   dbg (     0,     0,0) 
A4GL_debug_print_field_opts()  UUU Field 0x22af6e0 attribs= O_VISIBLE 
O_ACTIVE O_PUBLIC O_EDIT O_STATIC: (1             )
ioform.c             3571   dbg (     0,     0,0) 
A4GL_mja_set_field_buffer()  Before trim:1.000
ioform.c             3585   dbg (     0,     0,0) 
A4GL_mja_set_field_buffer()  after trim:1.000
ioform.c             3599   dbg (     0,     0,0) 
A4GL_mja_set_field_buffer()  Setting 0x22af6e0 0 to 1.000 (0)
ioform.c             3600   dbg (     0,     0,0) 
A4GL_mja_set_field_buffer()  field buffer set to '1.000         '
ioform.c             3601   dbg (     0,     0,0) 
A4GL_mja_set_field_buffer()  Currwin=0x229c870
iarray.c             1849   dbg (     0,     0,0) 
A4GL_mja_pos_form_cursor ()  mja_pos_form_cursor called with 
form=0x22b0dc0 field would be 0x22af6e0
ioform.c             3615   dbg (     0,     0,0) 
A4GL_mja_set_field_buffer()  Touched Window
ioform.c             3629   dbg (     0,     0,0) 
A4GL_mja_set_field_buffer()  Refreshed Window
iarray.c             587    dbg (     0,     0,0) 
pop_iarr_var             ()  fbuff=1.000
iarray.c             591    dbg (     0,     0,0) 
pop_iarr_var             ()  FA_S_PICTURE
iarray.c             633    dbg (     0,     0,0) 
pop_iarr_var             ()  COPY gets buff = 1.000 ptr=1.000
iarray.c             644    dbg (     0,     0,0) 
pop_iarr_var             ()  ptr=1.000
ioform.c             5498   dbg (     0,     0,0) 
A4GL_fld_data_ignore_format()  FLD_DATA_IGNORE_FORMAT : 1.000
ioform.c             5506   dbg (     0,     0,0) 
A4GL_fld_data_ignore_format()  Has format
ioform.c             5539   dbg (     0, 0,0) 
A4GL_fld_data_ignore_format()  COPY -> 1000 instead
ioform.c             5700   dbg (     0,     0,0) 
A4GL_fld_data_ignore_format()  Returning : 1000
iarray.c             648    dbg (     0,     0,0) 
pop_iarr_var             ()  ptr2=1000
iarray.c             653    dbg (     0,     0,0) 
pop_iarr_var             ()  Free ptr
mem.c                171    dbg (     0,     0,0) 
acl_free_full            ()  Free 0x22b21b0 iarray.c 655
builtin_d.c          569    dbg (     0,     0,0) 
A4GL_push_char           ()  Push char...'1000' (0x22b21b0)
builtin_d.c          583    dbg (     0,     0,0) 
A4GL_push_char           ()  not (blank first not second) '1000'
builtin_d.c          588    dbg (     0,     0,0) 
A4GL_push_char           ()  Created ptr=0x22b21d0
stack.c              833    dbg (     0,     0,0) 
A4GL_char_pop_size       ()  A4GL_char_pop...
stack.c              954    dbg (     0,     0,0) 
A4GL_char_pop_size       ()  Looks like it was a string..'1000'



On 2016-01-27 12:41, Øyvind Gjerstad wrote:
> Forgot to attach a test program
>
> On 2016-01-27 11:34, Øyvind Gjerstad wrote:
>> This is a strange one. When I set A4GL_NUMERIC="," (comma as decimal 
>> separator), and reading decimal values using input array, the numbers 
>> are multiplied by 100. This does not happen when A4GL_NUMERIC is not 
>> set (or when it is set to ".").
>>
>> This is with 1.2.36 on Linux.
>>
>> Has anyone seen something like that before?
>> -- 
>>
>> *Øyvind Gjerstad *
>> Systemkonsulent
>>
>> M +47 909 41 485
>> [email protected] <mailto:[email protected]>
>>
>> *____________________ _*
>>
>>
>> *PostNord AS *
>> T +47 09300
>> IT og Forretningsutvikling
>> Øran Vest
>> Postboks 100
>> 6301 Åndalsnes
>> www.postnord.no <http://www.postnord.no>
>>
>
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
>
>
> _______________________________________________
> Aubit4gl-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140

_______________________________________________
Aubit4gl-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.