Library Version Byte Codes

Thad Bogert thad at technosolver.com
Tue Jan 11 20:00:06 UTC 2022


Brilliant!  Thank You!

> On Jan 11, 2022, at 2:39 PM, Kelly Burgess <kellyb at montana.com> wrote:
> 
> Hi Thad,
> 
>> Does someone have a list of byte codes for determining what major version of Studio has modified a library?
> 
> Here's the Applescript I use to create a droplet app that reports the version of the Omnis library you drop on it.
> 
> Kelly
> 
> on open files_
> 	repeat with file_ in files_
> 		set file_ to POSIX path of file_
> 		-- read the first three bytes
> 		set foo to (open for access (POSIX file file_))
> 		set txt to (read foo for 3)
> 		close access foo
> 		-- map bytes to version
> 		set byteOne to ASCII number (first character of txt)
> 		set byteTwo to ASCII number (second character of txt)
> 		set byteThree to ASCII number (third character of txt)
> 		set dialogMsg to file_ & " is not a Studio 3 or Studio 4 library."
> 		if byteTwo = 1 then -- 0x01
> 			if byteOne = 44 then -- 0x2C
> 				set dialogMsg to file_ & " is a Studio 3.x library."
> 			end if
> 			if byteOne = 45 then -- 0x2D
> 				set dialogMsg to file_ & " is a Studio 4.x library."
> 			end if
> 			if byteOne = 46 then -- 0x2E
> 				set dialogMsg to file_ & " is a Studio 4.3.1+ library."
> 			end if
> 			if byteOne = 47 then -- 0x2F
> 				set dialogMsg to file_ & " is a Studio 5.0.x library."
> 			end if
> 			if byteOne = 48 then -- 0x30
> 				set dialogMsg to file_ & " is a Studio 5.1.x library."
> 			end if
> 			if byteOne = 49 then -- 0x31
> 				set dialogMsg to file_ & " is a Studio 5.2.x library."
> 			end if
> 			if byteOne = 50 then -- 0x32
> 				set dialogMsg to file_ & " is a Studio 6.0.x library."
> 			end if
> 			if byteOne = 51 then -- 0x33
> 				set dialogMsg to file_ & " is a Studio 6.1.x library."
> 			end if
> 			if byteOne = 52 then -- 0x34
> 				set dialogMsg to file_ & " is a Studio 8.0.x library."
> 			end if
> 			if byteOne = 53 then -- 0x35
> 				set dialogMsg to file_ & " is a Studio 8.1.x library."
> 			end if
> 			if byteOne = 54 then -- 0x36
> 				set dialogMsg to file_ & " is a Studio 10.0.x library."
> 			end if
> 			if byteOne = 55 then -- 0x37
> 				set dialogMsg to file_ & " is a Studio 10.1.x library."
> 			end if
> 			if byteOne = 56 then -- 0x38
> 				set dialogMsg to file_ & " is a Studio 10.2.x library."
> 			end if
> 			if byteThree = 1 then
> 				set dialogMsg to dialogMsg & " (Unicode)"
> 			end if
> 		end if
> 		display dialog dialogMsg buttons {"OK"} default button "OK"
> 	end repeat
> end open
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list