Skip to content

Commit

Permalink
Add version number to info-struct, remove restriction on version
Browse files Browse the repository at this point in the history
  • Loading branch information
jaakkor2 committed Jan 27, 2024
1 parent 13c595a commit c9168b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/metadata.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function metadata(a)
buildstring = _read_string!(a, offset, 4)
m = match(r"Version (?<version>.*)$", buildstring)
isnothing(m) && throw(ErrorException("Could not determine JMP version"))
VersionNumber(m["version"]) v"15" || throw(ErrorException("The file is saved with too old JMP version ($(m["version"])). Consider saving it with a more recent version of JMP."))
version = VersionNumber(m["version"])

# brute-force find the offset to column data index
offset = find_column_data_offset(a, ncols)
Expand All @@ -25,7 +25,7 @@ function metadata(a)

colnames, coloffsets = column_info(a, offset, ncols)

Info(buildstring, savetime, nrows, ncols, Column(colnames, colformatting, coloffsets))
Info(version, buildstring, savetime, nrows, ncols, Column(colnames, colformatting, coloffsets))
end

"""
Expand Down
1 change: 1 addition & 0 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ struct Column
end

struct Info
version::VersionNumber
buildstring::String
savetime::DateTime
nrows::Int64
Expand Down

0 comments on commit c9168b8

Please sign in to comment.