Jump to content

FileOpen Raw Mode


Jon
 Share

Recommended Posts

  • Administrators

So is it likely to be used by anyone in normal scripting circles for anything other than going "huh" when they see it in the help file? It don't see why it's there tbh (apart from bugging me when debugging the file code :shocked: )

Link to comment
Share on other sites

I was playing around with this question, and found that the output from this script, when using RAW mode is much longer.. How is that?

$Filename = FileOpenDialog("Try this on image files such as JPG","", "All Files (*.*)")
If @error Then Exit

;Read mode
$Filehandle = FileOpen($Filename,0)
$Read = FileRead($Filehandle,512)
FileClose($Filehandle)

$Split = StringSplit($Read,'')

Dim $Return
For $x = 1 to $Split[0]
    $Return &= Hex($Split[$x],2) & " "
Next

MsgBox(0, "Normal Read Mode", $Return)


; Raw read mode
$Filehandle = FileOpen($Filename,4)
$Read = FileRead($Filehandle,512)
FileClose($Filehandle)

$Split = StringSplit($Read,'')

Dim $Return
For $x = 1 to $Split[0]
    $Return &= Hex($Split[$x],2) & " "
Next

MsgBox(0, "RAW Mode", $Return)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...