GetAppVersion and GetBuildVersion for v11 software not returning full version

This section is for general discussion about Gadgets
Post Reply
User avatar
adze_cnc
Vectric Wizard
Posts: 4324
Joined: Sat Jul 27, 2013 10:08 pm
Model of CNC Machine: AXYZ 4008
Location: Vancouver, BC, Canada

GetAppVersion and GetBuildVersion for v11 software not returning full version

Post by adze_cnc »

I'm thinking of writing a gadget (first ever). I need to make sure that it is not run in a program version 10 or above as it will be picking tools from the database and those methods are different than in program version 9. To do this I'd read the version and abort if 10 or greater.

To double-check what information regarding program version is being returned by the gadget API I used the following code snippet.

Code: Select all

-- VECTRIC LUA SCRIPT

function b2str(b) return b and "true" or "false" end 

function main()
	local aspire = b2str(IsAspire())
	local beta = b2str(IsBetaBuild())

	MessageBox("Aspire: " .. aspire .. " ; Beta: " .. beta .. " ; App: " .. GetAppVersion() .. " ; Build: " .. GetBuildVersion())

	return true;
end
For VCarve Pro 9.5 it returned the following:

:
VCarve Pro v9.519
VCarve Pro v9.519
:
For a lark I thought I'd try it on VCarve Pro Trial version 11 and it returned the following:

:
VCarve Pro Trial v11.006
VCarve Pro Trial v11.006
:
I'd have expected it to return an app and/or build version of "11.006" rather than just "11".

Can anyone with a "real" version 11 (or even v10.xxx) check to see what your program returns?

Steven

User avatar
Adrian
Vectric Archimage
Posts: 14544
Joined: Thu Nov 23, 2006 2:19 pm
Model of CNC Machine: ShopBot PRS Alpha 96x48
Location: Surrey, UK

Re: GetAppVersion and GetBuildVersion for v11 software not returning full version

Post by Adrian »

11 works as you've seen.

10.5 displays 27 for both app and build, weird as my version is 10.514 so no idea why it's just displaying 27.

10 display 10.022 which is correct for my version.

User avatar
adze_cnc
Vectric Wizard
Posts: 4324
Joined: Sat Jul 27, 2013 10:08 pm
Model of CNC Machine: AXYZ 4008
Location: Vancouver, BC, Canada

Re: GetAppVersion and GetBuildVersion for v11 software not returning full version

Post by adze_cnc »

Thanks for that, Adrian. The version 10.5 result is decidedly weird.

I was just thinking. It should be possible to write a gadget that works under v9.xxx and v10 & 11 even with the differences in tool database handling.

You'd use something similar to "c" preprocessor statements:

Code: Select all

BUILD = GetBuildVersion()
...

if BUILD >=10 then
	GetToolv10method()
else
	GetToolv9method()
end
Since the gadget is interpreted and not compiled, if you are running under v11 then the code in the v9 specific functions will never be run so it doesn't matter that the code is using constructors and methods are not present in the v11 API.

You just wouldn't be able to save a default for next time.

User avatar
adze_cnc
Vectric Wizard
Posts: 4324
Joined: Sat Jul 27, 2013 10:08 pm
Model of CNC Machine: AXYZ 4008
Location: Vancouver, BC, Canada

Re: GetAppVersion and GetBuildVersion for v11 software not returning full version

Post by adze_cnc »

I forgot to mention in the first post that to run the code people can select it, copy it to the clipboard (Ctrl+C), and then paste it into an open file in VCarve / Aspire (etc.).

Post Reply