String :=FORMAT(integer)

shivenshiven Member Posts: 9
Hi,

Sorry but I'm newbie in C/SIDE and I have small problem.

Normaly ..that's very easy (I think :oops: ):

integer :=1;

string := format(integer);

Why : string = "0" ????

Thanks in advance

Answers

  • BeliasBelias Member Posts: 2,998
    it's not possible; the message of this code returns 1
    integer := 1;
    string := format(integer);
    message(string);
    
    check your code better...where did you put it?
    BTW: it's not a good habit to name the variables like this: althought "integer" is not a reserved word, like "THEN", "IF", "BEGIN" etc. it is also the name of a nav table. this can lead to bugs if you're programming (for example) a report based on the integer table. Actually, this is probably the source of your problem :-k
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • shivenshiven Member Posts: 9
    Thanks.
    The name of the variables is just for the exemple.

    ok I start again with the real name of the variables...

    It's a report, and gDecQtyOnSticker is a TextBox (Integer)

    gDecQtyOnStickerTxt:=FORMAT(gDecQtyOnSticker)

    gCUPQH_BARECODE.C128MakeBarcode(gDecQtyOnStickerTxt, rTempPic3, 5300, 423, 96, TRUE);


    In my function C128MakeBarcode I need to have a string... and I have a string but gDecQtyOnStickerTxt is always ="0"...
  • BeliasBelias Member Posts: 2,998
    use debugger, and check the value of gDecQtyOnSticker
    OR
    put this line BETWEEN your 2
    message(gDecQtyOnStickertxt);
    if it returns 0, it means that is your decimal variable to not be evaluated.
    if it returns something <>0, you've probably done something in C128MakeBarcode function that transform your gDecQtyOnStickertxt to 0.
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • shivenshiven Member Posts: 9
    Sorry ](*,)

    This line initializes the gDecQtyOnStickerTxt in the request form and the gDecQtyOnSticker = 0.
    I put this line in "OnPreSection" and now it's ok.

    Thank you a lot for you're help.

    Best regard
  • BeliasBelias Member Posts: 2,998
    please, don't put business logic under the sections unless you can't do it in another way. this makes the code hard to find; moreover the code is not executed if you're running on 3tiers (RTC with rdlc report layout).
    section triggers are intended to manage visibility of the section only (through Currreport.showoutput instruction).
    if possible move the code in the onaftergetrecord.
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • shivenshiven Member Posts: 9
    Belias wrote:
    please, don't put business logic under the sections unless you can't do it in another way. this makes the code hard to find; moreover the code is not executed if you're running on 3tiers (RTC with rdlc report layout).
    section triggers are intended to manage visibility of the section only (through Currreport.showoutput instruction).
    if possible move the code in the onaftergetrecord.

    =D>

    I've moved.

    Thanks a lot !
  • BeliasBelias Member Posts: 2,998
    you're welcome!
    and remember to change the attribute of your topic :wink:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.