Forum FlexPro – Discuss your topic!

FPSricpt ChangeUnit function does not work ?

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

Ansicht von 3 Beiträgen - 1 bis 3 (von insgesamt 3)
  • 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.

Ansicht von 3 Beiträgen - 1 bis 3 (von insgesamt 3)
  • Du musst angemeldet sein, um auf dieses Thema antworten zu können.