Here's a teeny tiny very minor suggestion. A better way to do this:-
Code:
public function LOWORD(byval value as long) as integer
return value and clng("&hffff")
End Function
CLng is there to prevent TwinBASIC from sign extending the 2 byte Integer form of &hFFFF to a 4 byte Integer of value &hFFFFFFFF when we actually want &h0000FFFF
This exact function in VB.Net would look like this:-
Code:
Public Function LOWORD(ByVal value As Integer) As Short
Return value And &HFFFFI
End Function
VB.Net allows you to specify the data type of that hex value with a suffix, which in this case is the letter I. This means it's not going to sign extend a 2 byte Integer to a 4 byte integer, since it starts with a 4 byte Integer.
Again, this is just a minor suggestion and not something I would consider an immediate concern. I just think using CLng on a String on like that for this is a bit wild. It just reeks of a kind of dirtiness that is a bit uncomfortable.