hexagon logo

IF with TRACEFIELD

Hello everyone,

I was trying to use IF with TRACEFIELD so, do you have an example fo it, please?

Thank you,

is that correct?

IF/GETTRACEVALUE("partN")
ASSIGN/V1=10
ASSIGN/V2=20
END_IF/
Parents
  • kama2818,
    The condition value that you posted will always be True.
    You will need to compare the GETTRACEVALUE("partN") value to the input value of the Trace Field.

    Example code
    [COLOR=#8e44ad]ASSIGN/V1=0
    ASSIGN/V2=0[/COLOR]
    TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=partN ; partN : 10
    [COLOR=#8e44ad]IF/GETTRACEVALUE("partN")==10
    ASSIGN/V1=10
    ASSIGN/V2=20
    END_IF/[/COLOR]
    

Reply
  • kama2818,
    The condition value that you posted will always be True.
    You will need to compare the GETTRACEVALUE("partN") value to the input value of the Trace Field.

    Example code
    [COLOR=#8e44ad]ASSIGN/V1=0
    ASSIGN/V2=0[/COLOR]
    TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=partN ; partN : 10
    [COLOR=#8e44ad]IF/GETTRACEVALUE("partN")==10
    ASSIGN/V1=10
    ASSIGN/V2=20
    END_IF/[/COLOR]
    

Children
No Data