Forum FlexPro – Discuss your topic!

FPSricpt ChangeUnit function does not work ?

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Autor
    Beiträge
  • #12882
    HerveM1234HerveM1234
    Teilnehmer

    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
    Teilnehmer

    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
    Teilnehmer

    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)
  • Du musst angemeldet sein, um auf dieses Thema antworten zu können.