Hi.
Can you give me a help with aligment numbers from right side? I always use code like this:
Sub LCDprodleva
odpocet = prodleva - kontakt
Locate 2,16
If odpocet < 1000 then
Print "0"
End If
If odpocet < 100 then
Print "0"
End If
If odpocet < 10 then
Print "0"
End If
Print odpocet
If odpocet = 0 Then
Locate 2,16
Print " "
End If
End Sub
But I thing there must be a better way to do this.
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would eliminate one locate and any chance of a flicker this way:
Sub LCDprodleva
odpocet = prodleva - kontakt
Locate 2,16
If odpocet = 0 Then
Print " "
Else
Select Case odpocet
Case < 1000
Print "0"
Case < 100
Print "0"
Case < 10
Print "0"
End Select
Print odpocet
End If
End Sub
-Bert
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi.
Can you give me a help with aligment numbers from right side? I always use code like this:
But I thing there must be a better way to do this.
Thanks
I would eliminate one locate and any chance of a flicker this way:
-Bert