Thanx for the tips,
I went and put the indenting in and took out the "GOTOs"
It does look a lot neater like this.
Code:
Break ON
$A=1
$Z=1
While $A=1
If $Z=1
$X=1
$Power=1
$Length=1
$Binval=""
$Exponent=2
$Expval=1
$Z=0
CLS
?" BitCrusher"
?" Decimal to Binary Calculator"
?" Made by Muesli"
???" Decimal value: "
Gets $Decval
$EndDecval= $Decval
EndIf
While $X=1
While Val($Expval) < Val($Power)
$Exponent= Val($Exponent) *2
$Expval= Val($Expval) +1
Loop
If Val($Decval) - Val($Exponent)<1
$X=2
Else
$Power= Val($Power) + 1
$Length= Val($Length) + 1
EndIf
Loop
While $X=2
$Exponent=2
While Val($Expval) > 0
$Exponent= Val($Exponent) *2
$Expval= Val($Expval) -1
Loop
If Val($Decval) - Val($Exponent)>=0
$Decval= Val($Decval) - Val($Exponent)
$Binval= $Binval + "1"
Else
$Binval= $Binval + "0"
EndIf
$Power= Val($Power) - 1
$Length= Val($Length) - 1
$Expval= Val($Power)
If $Length<0
$X=3
EndIf
Loop
If $X=3
If $Decval=1
$Binval= $Binval + "1"
Else
$Binval= $Binval + "0"
EndIf
??"The Decimal number "$EndDecval" In Binary is "$Binval
?
?"Again? y/n" Get $Key
If $Key=y
$X=1
$Z=1
Else
Exit
EndIf
EndIf
Loop