PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 25
→
WX - Converter decimal -> binario
WX - Converter decimal -> binario
Started by adrianoboller, Aug., 19 2015 10:33 PM - 1 reply
Connect yourself…
adrianoboller
#1
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on August, 19 2015 - 10:33 PM
// by Jose Elielson
// converter dec -> bin
x is
int
=
edit_decimal
r is
int
=
0
y is
int
=
0
b is
string
=
""
IF
x
>
1
LOOP
y
=
IntegerPart
(x/
2
)
r
=
x
- (y*
2
)
b
=
NumToString
(r) +
b
IF
y
=
1
THEN
b
=
"1"
+
b
BREAK
END
x
=
y
END
ELSE
b
=
NumToString
(x)
END
Info
(b)
Report
0
0
adrianoboller
#2
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on August, 19 2015 - 10:34 PM
// José Elielson
// Binario -> Decimal
// observacao
// colocar o inputmask no Exit do Edit
// edit_binario..InputMask = "regexp:[0-1]{0,16}"
b is
string
=
edit_binario
i is
int
=
0
k is
int
=
0
y is
int
=
0
x is
int
=
0
j is
int
=
Length
(
NoSpace
(b)
)
FOR i
=
j TO
1
STEP
-
1
y
=
Val
(
Middle
(b,i,
1
)
)
IF
y
=
1
THEN
x
=
x
+ (
2
^
(k)
)
END
k
+
+
END
Info
(x)
Report
0
0
→ Go back to WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text