RbCafe

Shell Example 1

Posted in Codex by RbCafe on the October 2nd, 2005

Hi

Dim sh As New Shell

sh.Mode = 0
sh.Execute “env | grep SHELL”
App.DoEvents ‘ tee hee hee
StaticText1.Text = sh.Result

From Tim Jones

Hex to number

Posted in Codex by RbCafe on the October 2nd, 2005

Hi 8)

Dim hex as string
Dim num as integer
‘ number 0 to 15 to hex:
hex = mid(”0123456789ABCDEF”, num+1,1)
‘ hex digit to number :
num = instr(”0123456789ABCDEF”,hex)-1

To display a memoryblock in hex, access it one byte at a time, and for each
byte:

Dim byte as integer
Dim hexbyte, hextable as string
hextable = “0123456789ABCDE”
hexbyte = mid(hextable,byte\16 + 1,1) + mid(hextable, byte mod 16 + 1, 1)

And hexbyte back to byte is:

Dim byte as integer
‘byte is 0 to 255
Dim hexbyte, hextable as string
hextable = “0123456789ABCDE”
byte = instr(hextable, left(hexbyte,1))-1
byte = 16*byte + instr(hextable, right(hexbyte,1))-1


Page 12 of 13« First...«910111213»