Forum FlexPro – Discuss your topic!

FPSricpt ChangeUnit function does not work ?

Accueil > Community > FPScript > FPSricpt ChangeUnit function does not work ?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #12882
    HerveM1234HerveM1234
    Participant

    Hi,

    With :

    Dim toto
    
    toto=Signal({1, 3, 5, 7}, {0, 1, 2, 3}) 
    ChangeUnit(toto,"test")
    Return(toto)
    

    this formula, the formula’s units remains empty ! Why?

    #8542
    HerveM1234HerveM1234
    Participant

    Hi,

    With :

    Dim toto
    
    toto=Signal({1, 3, 5, 7}, {0, 1, 2, 3}) 
    ChangeUnit(toto,"test")
    Return(toto)
    

    this formula, the formula’s units remains empty ! Why?

    #9392
    Bernhard KantzBernhard Kantz
    Participant

    The function ChangeUnit() returns a dataset with the unit set/converted to the trailing parameters. It does not alter the first argument itself. To get the desired result you may write:

    
    Dim toto = Signal((4, 1, 2), 1)
    ChangeUnit(toto, "test")
    

    Note: The last expression will become the value of the formula, Return is not necessary.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.