-
FlexPro
- At a Glance
- Features & Options
- Applications
- All Advantages
- What’s New in FlexPro 2021
- Try FlexPro For Free
- FlexPro View OEM Freeware
- Buying Guide
- Login
- Language
- +49 6894 929600
- infoweisang.com
- Google Maps
- Products
- News
- Support
- Company
- Contact
- Login
- Language
- +49 6894 929600
- infoweisang.com
- Google Maps
converting binary to decimal
- This topic has 2 replies, 2 voices, and was last updated 19 years, 3 months ago by Luca Berardi.
-
AuthorPosts
-
September 22, 2005 at 6:02 pm #12660Luca BerardiParticipant
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 = 68How can we do that in FlexPro?
best regardsSeptember 22, 2005 at 6:02 pm #8323Luca BerardiParticipantwe 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 = 68How can we do that in FlexPro?
best regardsOctober 8, 2005 at 7:34 am #9075Bernhard KantzParticipantThis 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 -
AuthorPosts
- You must be logged in to reply to this topic.