FlexPro
HistoryBase
Engineering
Training
Downloads
FlexPro-Support
Wissen
Community
Über Uns
Referenzen
Jobs
Allgemeiner Kontakt
Händlerverzeichnis
FlexPro-Support
DE
EN
FR
Placeholder
Produkte und Lösungen
Support und Downloads
Unternehmen
Magazin
Kontakt
Sprache
MyWeisang

Account Einstellungen

Topic

converting binary to decimal

Startseite ' Community ' Allgemein ' converting binary to decimal

Anzeigen von 3-Stellen - 1 bis 3 (von insgesamt 3)
  • Autor
    Beiträge
  • #34109
    Luca Berardi
    Teilnehmer

    we have a txt file which contains a column of binary data, this is an example
    0111001
    10010
    1101
    1000100
    we import this data as a txt file and we want to obtain the corresponding decimal value for each row in another column.
    111001 = 57
    10010 = 18
    1101 = 13
    1000100 = 68

    How can we do that in FlexPro?
    best regards

    #34111
    Luca Berardi
    Teilnehmer

    we have a txt file which contains a column of binary data, this is an example
    0111001
    10010
    1101
    1000100
    we import this data as a txt file and we want to obtain the corresponding decimal value for each row in another column.
    111001 = 57
    10010 = 18
    1101 = 13
    1000100 = 68

    How can we do that in FlexPro?
    best regards

    #34110
    Bernhard Kantz
    Teilnehmer

    This FPScript code runs under FlexPro 7:

    dim b = { 101, 110, 0 } // Example binary data series
    Dim d = 0. # NumberOfRows(b) // Result decimal data series
    Dim n = 8 // Maximum number of bits to convert
    For i = 0 To n – 1 Do
    d = d + (b & 1) * 2 ^ i
    b = b / 10
    End
    Return d

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