![ContractedBlock.gif](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
Fn GetMaxFileVersion theMaxFile
=
(
local versionFloat,theBinStream,keyWord,notFind,textFromBin,binEnd
versionFloat = 0
if isMaxFile theMaxFile do
(
theBinStream = fopen theMaxFile " r "
keyWord = " Version: "
notFind = true
textFromBin = ""
fseek theBinStream 0 #seek_end
binEnd = ftell theBinStream
fseek theBinStream 0 #seek_set
while (ftell theBinStream < binEnd ) and notFind do
(
textFromBin = ReadString theBinStream
if textFromBin == " V " do
(
for i = 1 to keyWord.Count - 1 do textFromBin += ReadString theBinStream as string
)
if keyWord == textFromBin do
(
versionString = ""
for i = 1 to 5 do versionString += ReadString theBinStream as string
versionFloat = versionString as float
notFind = false
)
)
FClose theBinStream
)
versionFloat
)
GetMaxFileVersion(getOpenFileName())
(
local versionFloat,theBinStream,keyWord,notFind,textFromBin,binEnd
versionFloat = 0
if isMaxFile theMaxFile do
(
theBinStream = fopen theMaxFile " r "
keyWord = " Version: "
notFind = true
textFromBin = ""
fseek theBinStream 0 #seek_end
binEnd = ftell theBinStream
fseek theBinStream 0 #seek_set
while (ftell theBinStream < binEnd ) and notFind do
(
textFromBin = ReadString theBinStream
if textFromBin == " V " do
(
for i = 1 to keyWord.Count - 1 do textFromBin += ReadString theBinStream as string
)
if keyWord == textFromBin do
(
versionString = ""
for i = 1 to 5 do versionString += ReadString theBinStream as string
versionFloat = versionString as float
notFind = false
)
)
FClose theBinStream
)
versionFloat
)
GetMaxFileVersion(getOpenFileName())