$MACRO getbits(w,msb,lsb) ((w SHR lsb) AND NOT((NOT 0???) SHL (msb-lsb+1)))
$MACRO setbits(w,msb,lsb,v) ((NOT(NOT((NOT 0???) SHL (msb-lsb+1)) SHL lsb) AND w) OR (v SHL lsb))
$DEFINE keypressenter 13
$DEFINE keydownenter 13
$DEFINE keydownup 38
$DEFINE keydowndown 40
$DEFINE keydownpageup 33
$DEFINE keydownpagedown 34
DECLARE FUNCTION str2num(s AS STRING) AS VARIANT
FUNCTION str2num(s AS STRING) AS VARIANT
DIM n AS STRING,n2 AS STRING *2
n=UCASE$(LTRIM$(RTRIM$(s)))
n2=LEFT$(n,2)
IF LEFT$(n,1)="$" THEN
str2num=VAL(CONVBASE$(MID$(n,2),16,10))
ELSEIF RIGHT$(n,1)="H" THEN
str2num=VAL(CONVBASE$(LEFT$(n,LEN(n)-1),16,10))
ELSEIF (n2="0X") OR (n2="&H") THEN
str2num=VAL(CONVBASE$(MID$(n,3),16,10))
ELSE
str2num=VAL(n)
END IF
END FUNCTION
|