| Autor |
Mesaj |
Ghitza
Founder


Data inscrierii: 15/Mar/2008 Mesaje: 161 Localitate: Baia Mare |
|
AutoIt - Din baza 10 in baza 2 |
|
 |
 |
#include <GUIConstants>
#Include <String>
#NoTrayIcon
$main = GUICreate("Convert to ... |3453 2", 300, 100)
GUISetBkColor(0x000000)
$input = GUICtrlCreateInput("", 8, 8, 280, 21, BitOR($ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 8)
$label = GUICtrlCreateLabel("Baza 2: ", 8, 36, 280, 21)
$copyright = GUICtrlCreateLabel(Chr(169) & " " & "by Fodor Sergiu" & " " & "(Cyber)", 165, 86, 135, 14)
$convert = GUICtrlCreateButton("!convert!", 20, 60, 80, 25, 0)
$clear = GUICtrlCreateButton("!clear!", 108, 60, 80, 25, 0)
$exit = GUICtrlCreateButton("!exit!", 194, 60, 80, 25, 0)
GUISetState(@SW_SHOW)
GUICtrlSetColor ($label, 0xFF0033)
GUICtrlSetColor ($copyright, 0x666666)
Func Dec2Bin($nr)
While 1
Dim $text
$rest = MOD($nr, 2)
$text = $text & $rest
$nr = ($nr - $rest) / 2
Select
Case $nr = 0
ExitLoop
EndSelect
WEnd
$text = _StringReverse($text)
Return $text
EndFunc
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $convert
$numar = GuiCtrlRead($input)
$r = StringIsInt ( $numar )
If $r = 1 Then
$b2 = Dec2Bin($numar)
GUICtrlSetData($label, "Baza 2 : "& $b2)
EndIf
Case $clear
GUICtrlSetData($input, "")
GUICtrlSetData($label, "Baza 2 : ")
Case $exit
ExitLoop
EndSwitch
WEnd |
|
|
| 05/05/2008 09:56 |
|
 |
tcapital
Junior

Data inscrierii: 25/Iul/2012 Mesaje: 5 Localitate: Great Britain |
|
|
|
Every word in your article are true. So if someone writes negative reviews do not pay attention.
|
|
| 31/08/2012 11:51 |
|
 |
|
|
Nu puteti crea un subiect nou in acest forum Nu puteti raspunde in subiectele acestui forum Nu puteti modifica mesajele proprii din acest forum Nu puteti sterge mesajele proprii din acest forum Nu puteti vota in chestionarele din acest forum
|
Powered by phpBB © 2001, 2005 phpBB Group Fa-ti si tu propriul forum GRATUIT, pe www.myforum.ro
|
|