I think what I'm really trying to say here is that, if we want (a) to equal 100, and we can predict this value, then why use a formula? (It's unnecessary maths)
Code:
Public Function DrawLCD()
'-----------------------------------------------------------------------------
'// 2 Line 16 LCD_Chrs 5x7 matrix '
'-----------------------------------------------------------------------------
Dim i As Long 'General working var for nested loops
Dim j As Long '^
Dim k As Long '^
Dim f As Long '^
Dim e As Long '^
Dim h As Long '^
'// Draw display matrix with all segs off '
For LCD_Row = 0 To 1 '2 lines
For LCD_Chrs = 0 To 15 '16 chrs per line
For f = 0 To 7 'Matrix row
For k = 0 To 4 'Matrix col
For j = 0 To Draw_Scale - 1 'Ea seg is (dscale x dscale) pixels
For i = 0 To Draw_Scale - 1 '^
SetPixelV LCD.hdc, 2 + i + k * (Draw_Scale + 1) + (LCD_Chrs * Draw_Scale * 6) + (LCD_Chrs * 4), 3 + j + (f * (Draw_Scale + 1)) + (LCD_Row * Draw_Scale * 9) + LCD_Row * 7, vbGreen
Next
Next
Next
Next
Next
Next
I'm forced into using calculations with the above code because we can't easily predict the values of the variables without making things even more complex than they already are. So there's plenty of valid reasoning behind this predicate arrangement. But if we can predict what we want, and it's feasible to do so, why not hard code it???
<hr/>
Bookmarks