Thanks agraham. It will be fixed (both will return a boolean).
Three new values will be added:
optimized - boolean which will be true for optimized compiled applications.
CRunner
b4p
Is there a need for three? As b4p and CRunner are mutually exclusive you could use one slot named, say Host or B4P and do a GetType() on it to find out which and that also tells you if its optimised compiled or not!
There is no real need. However only two of the three will be really added in any case and the 'optimized' flag could be useful even in cases where you don't need or have the knowledge of the more internal B4P or CRunner type.
In that case how using the same slot for b4p and cRunner. Then it will always be there and we won't get an exception (which is what I think happens) if we try to access the missing slot.
'optimized' flag could be useful even in cases where you don't need or have the knowledge of the more internal B4P or CRunner type.
No exception will be thrown. It will return a null value (getting a non exist slot creates a new slot).
Anyway the preferred way should be to first check the optimized flag and then take the right value.
I agree that there are other reasonable solutions to do it as well.
I thought you were wrong but you're right as usual ! I used the following code to test my libraries under 6.50 and 6.80 and without thinking about it assumed it was the slot access that threw an exception but of course is the cast to double that fails - silly me .
B4X:
try
{
fixX = (double)(Thread.GetData(Thread.GetNamedDataSlot("fixX")));
fixY = (double)(Thread.GetData(Thread.GetNamedDataSlot("fixY")));
}
catch
{
// allows versions of b4p earlier than 6.80 to use this library
}