REM: Include file for Hex Editor v4.7a PD 2003.

' initialize all default variables as integer.
DEFINT A-Z

' load all arrays during runtime.
REM $DYNAMIC

' get include files.
REM $INCLUDE: 'dta.bi'
REM $INCLUDE: 'qbx.bi'
REM $INCLUDE: 'wdta.bi'

' declare multiple file structure.
TYPE FileType
 ASCIIZ AS STRING*261
 FileAttribute AS INTEGER
 Handle AS INTEGER
 ShortFilename AS STRING*261
 Filename AS STRING*12
 CurrentUndo AS INTEGER
 MarkerCount AS INTEGER
 CurrentMarker AS INTEGER
 FilePage AS DOUBLE
 FilePosition AS DOUBLE
 PageRow AS DOUBLE
 PageColumn AS DOUBLE
 Buffer AS STRING*1
 FileByte AS STRING*1
 AsciiValue AS INTEGER
 FileLength AS DOUBLE
 CopyPositionStart AS DOUBLE
 CopyPositionPivot AS DOUBLE
 CopyPositionEnd AS DOUBLE
END TYPE

' declare windows filename structure.
TYPE WinFileType
 Name AS STRING*261 ' ASCIIZ
END TYPE

' declare dos filename structure.
TYPE DosFileType
 Name AS STRING*12 ' 8.3 DOS
END TYPE

' declare undo filename structure
TYPE UndoFileType
 UndoByte1(9) AS INTEGER
 UndoPosition1(9) AS DOUBLE
END TYPE

' declare marker filename structure.
TYPE MarkerFileType
 Markers1(9) AS DOUBLE
END TYPE

' declare undo structure.
COMMON SHARED UndoFile AS UndoFileType

' declare undo variables.
COMMON SHARED CurrentUndo AS INTEGER, UndoToggle AS INTEGER

' declare marker structure and variables.
COMMON SHARED MarkerFile AS MarkerFileType
COMMON SHARED CurrentMarker AS INTEGER, NewMarker AS INTEGER
COMMON SHARED MarkerCount AS INTEGER, MarkerPosition AS INTEGER

' declare menu area storage arrays.
COMMON SHARED Area1() AS INTEGER, Area2() AS INTEGER

' declare ascii character variables.
COMMON SHARED Hline AS INTEGER, Vline AS INTEGER
COMMON SHARED ULcorner AS INTEGER, URcorner AS INTEGER
COMMON SHARED LLcorner AS INTEGER, LRcorner AS INTEGER

' declare temporary file position variables.
COMMON SHARED Low AS DOUBLE, High AS DOUBLE, HeapSortOff AS INTEGER
COMMON SHARED TempPosition AS DOUBLE, TempPosition1 AS DOUBLE
COMMON SHARED TempPosition2 AS DOUBLE, TempPosition3 AS DOUBLE
COMMON SHARED FileDisplay AS INTEGER, FileDisplay2 AS INTEGER
COMMON SHARED TempFiles() AS STRING

' declare common program variables.
COMMON SHARED AsciiValue AS INTEGER, AsciiValue2 AS INTEGER
COMMON SHARED ASCIIValue3 AS DOUBLE, HexValue AS DOUBLE
COMMON SHARED CurrentWindow AS INTEGER, CurrentWindow2 AS INTEGER
COMMON SHARED PageColumn AS DOUBLE, PageRow AS DOUBLE
COMMON SHARED ScreenDrawn AS INTEGER, ScreenRow AS INTEGER
COMMON SHARED StatusMessage AS STRING, SupportedCall AS INTEGER
COMMON SHARED ValidFunction AS INTEGER

' declare filename/file position variables.
COMMON SHARED Column AS DOUBLE, Column2 AS DOUBLE
COMMON SHARED DumpFile AS STRING, Filename AS STRING
COMMON SHARED FileByte AS STRING*1, FileBytePosition AS DOUBLE
COMMON SHARED FileLength AS DOUBLE, FilePage AS DOUBLE
COMMON SHARED FilePosition AS DOUBLE, FilePosition2 AS DOUBLE
COMMON SHARED FirstByte AS DOUBLE, FilePage2 AS DOUBLE
COMMON SHARED LastByte AS DOUBLE, LastPage AS DOUBLE
COMMON SHARED NewByte AS DOUBLE, NextByte AS DOUBLE
COMMON SHARED NextLine AS DOUBLE, NextPage AS DOUBLE
COMMON SHARED NewPosition AS DOUBLE, NewPosition2 AS DOUBLE
COMMON SHARED PageColumn2 AS DOUBLE, PageRow2 AS DOUBLE
COMMON SHARED SeekPosition AS DOUBLE, SeekPosition2 AS DOUBLE
COMMON SHARED ShortFilename AS STRING, StorePosition AS DOUBLE

' declare all long filename common variables.
COMMON SHARED ASCIIZ AS STRING*261, ASCIIZ2 AS STRING*261
COMMON SHARED Buffer AS STRING*1, ConfigFile AS STRING
COMMON SHARED BASIC.DTA.OFF AS INTEGER, BASIC.DTA.SEG AS INTEGER
COMMON SHARED DTAfile AS DTAtype, ErrorTrap AS INTEGER, FileSize AS DOUBLE
COMMON SHARED FileAttribute AS INTEGER, Quote AS STRING, Handle AS INTEGER
COMMON SHARED Windows.Detected AS INTEGER, Wfile.Handle AS INTEGER
COMMON SHARED WDTAfile AS WDTAtype

' declare all common mouse variables.
COMMON SHARED Mouse.Present AS INTEGER, Mouse.Button1 AS INTEGER
COMMON SHARED Mouse.Button2 AS INTEGER, Mouse.Button3 AS INTEGER
COMMON SHARED Mouse.Row AS INTEGER, Mouse.Column AS INTEGER
COMMON SHARED Old.Mouse.Row AS INTEGER, Old.Mouse.Column AS INTEGER
COMMON SHARED Mouse.X AS INTEGER, Mouse.Y AS INTEGER

' common left click and drag mouse variables.
COMMON SHARED Mouse.Button1.Row AS INTEGER, Mouse.Button1.Column AS INTEGER
COMMON SHARED Mouse.Button1.X AS INTEGER, Mouse.Button1.Y AS INTEGER

' common default left click mouse variables.
COMMON SHARED Mouse.ButtonX AS INTEGER, Time1 AS SINGLE, MouseTime AS SINGLE
COMMON SHARED Mouse.RowX AS INTEGER, Mouse.ColumnX AS INTEGER

' declare filename variables for file menu box.
COMMON SHARED AmbiguateSwitch AS INTEGER
COMMON SHARED Attribute AS INTEGER, ASCIIZ3 AS STRING*261
COMMON SHARED Num.Dirs AS INTEGER, Num.Files AS INTEGER
COMMON SHARED Default.Drive AS INTEGER, Last.Drive AS INTEGER
COMMON SHARED Current.Drive AS INTEGER, Drive.Box.Line AS INTEGER

' declare structures for file menu box.
COMMON SHARED WinFileStruc AS WinFileType, DosFileStruc AS DosFileType

' declare menu screen location offsets for file menu box.
COMMON SHARED Xcoor AS INTEGER, Ycoor AS INTEGER

' declare menu variables for DropDownMenu.
COMMON SHARED CurrentMenu AS INTEGER, CurrentMenuSelection AS INTEGER

' declare variables for copy/paste.
COMMON SHARED CopyPositionStart AS DOUBLE, CopyPositionPivot AS DOUBLE
COMMON SHARED CopyPositionEnd AS DOUBLE, CopyStart AS DOUBLE
COMMON SHARED CopyByte AS STRING*1

' declare structure for multiple files.
COMMON SHARED File() AS FileType

' declare multiple file variables.
COMMON SHARED CurrentFile AS INTEGER, NumberFiles AS INTEGER

' declare temp file share variables.
COMMON SHARED Process.Number AS INTEGER

' declare interrupt structures.
COMMON SHARED InregsX AS RegTypeX, OutregsX AS RegTypeX

' declare author constants.
CONST Author="Erik Jon Oredson AS. CSci"
CONST Email="eoredson@yahoo.com"
CONST Urls="www.simtel.net www.filegate.net www.winsite.com"

' declare constants.
CONST Nul=""
CONST False=0
CONST True=-1
CONST Version="v4.7a"
CONST Release="r1.0a"
CONST Publish="07/21/2003."
CONST Status="Public Domain"
CONST Program="Hex Editor"

' declare colors.
CONST Black=0
CONST Blue=1
CONST Cyan=11
CONST Green=10
CONST Magenta=13
CONST Plain=7
CONST Red=12
CONST White=15
CONST Yellow=14

' declare bit constants.
CONST ReadOnlyBit=1
CONST HiddenBit=2
CONST SystemBit=4
CONST ArchiveBit=32

' declare mouse function constants.
CONST CheckMouse=0
CONST ShowMouse=1
CONST HideMouse=2
CONST MovePosition=4
CONST Position=3
CONST Button=5

' declare functions.
DECLARE FUNCTION Conanicalize$(V$)
DECLARE FUNCTION ReleaseTime()
DECLARE FUNCTION TestFile(V$)
DECLARE FUNCTION TrimSpaces$(V$)
DECLARE FUNCTION TimeElapsed(V1!,V2!)
DECLARE FUNCTION TimeNow!()

' declare record structure functions.
DECLARE FUNCTION Directories$(V%)
DECLARE FUNCTION Filenames$(V%)

' declare undo record structure functions.
DECLARE FUNCTION UndoByte%(V%)
DECLARE FUNCTION UndoPosition#(V%)

' declare marker record structure function.
DECLARE FUNCTION Markers#(V%)

' declare mouse functions.
DECLARE FUNCTION TestMouse()
DECLARE FUNCTION TestWindows()

' declare subroutines.
DECLARE SUB Deconcatenate(V$,V%)
DECLARE SUB DisplayBootUsage()
DECLARE SUB DisplayScreen()
DECLARE SUB DisplayScreen2()
DECLARE SUB DropDownMenu()
DECLARE SUB HelpScreen()
DECLARE SUB Menu(V1$,V2$,V3$,V4$)
DECLARE SUB MouseDriver()
DECLARE SUB MouseFunction(V1%,V2%)
DECLARE SUB MouseFunction2(V1%,V2%)
DECLARE SUB OpenCopyFiles()
DECLARE SUB PrintHelpScreens()
DECLARE SUB ReadConfigFile(V$)
DECLARE SUB ViewFiles(V%)
