View Single Post
06/25/14, 04:29 PM   #1
zgrssd
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 280
[implemented] Programmatical way to get the API version

There are cases where I would like to get the API version to make checks with in my code. In specific I need a way to detect if the API version changed and manaully reset the stored data to defaults then.

My Addon UTC can store the Categoreis that are enabeled for each tab in each chat container. I asume the current code will be good for a few more years, as there is no even remotely botusable function in the chat part I touch and I use Loops based on #Table and GetNum Functions.

However every time the API version changes the order of chat categories might change. So at least in the first start after a version change I have to reset the settings & data. Doing this via the existing Saved Var Versioning system is not viable (or nessesary for that matter).

All I need is a function "getAPIVersion()" that returns a int or string with the version (either works for me. Only doing an inequality check). Asuming it was not added with the 1.2.3 patch.