Free format vs Fixed format Messages

KisuKisu Member Posts: 381
I've been wondering what is the main difference of the 2 types of showing a value for example, I couldnt find a similar post about this in the forums so I made a new one.

There is a little example in Nav C/Side Intro document about using instrict c/al functions about MESSAGE. Last part of that there is this example whit message with 2 values, one formated as free and one with fixed. I tested that and didn't see any difference with the 2 examples. :-k

So I made some tests:

Value1 := 12345.678;
Value2 := 987.65;

MESSAGE('Ekarivi: Arvo 1 = %1, Arvo 2 = %2 \' + 
'Tokarivi: Arvo 1 = #1########, Arvo 2 = #2########', Value1, Value2);

MESSAGE('Arvo 1 testit: \' +
'%1\' +
'1#########\' +
'#1########\' +
'##1#######\' +
'###1######\' +
'####1#####\' +
'#####1####\' +
'######1###\' +
'#######1##\' +
'########1#\' +
'#########1\',Value1);

Funnily first Message box gave same values as their variables had without thousand mark and the second Message box gave all same value as the variable except line 2 was "10"

The PDF guide does not tell what is the purpose of # -marks in detail so I checked by leaving one mark off and it said: "the lenght of the source exceeds the size of the destination buffer", so you need to have that number 1 for the value 1 and atleast 8 x # -chars on it but not having the "1" in first of them.

Can someone give me some more details about this Fixed Format, I'm not having this on any project but would like to know this a little more detailed n_n

Thanks before hand.
K.S.

Comments

  • JPHSCJPHSC Member Posts: 67
    the #1###, #2#### format is used for fixed format, normally used on dialog boxes ..
    for messages you normally use the %1, %2 function ( for variable length ) .. .

    If you want to show your decimal values in a "special" way, take a look at the format function ..
Sign In or Register to comment.