Current SPAD.neXt Release: 0.9.12.123

This forum has closed. Please join our Discord Community.

SPAD.neXt online services are no longer available for SPAD.neXt Versions < 0.9.11.5

Scripting "GetDataDefinition" Function Change

General Discussions
Locked
ab-tools
Betatester
Posts: 483
Joined: 24 May 2015, 12:02
Location: Munich, Germany
Contact:
Status: Offline

Scripting "GetDataDefinition" Function Change

Post by ab-tools » 03 Sep 2017, 12:41

Hello,

after upgrading to the last (official) version 0.9.6.25 my scripts like this do not work anymore:

Code: Select all

using SPAD.neXt.Interfaces;
using SPAD.neXt.Interfaces.Events;
using SPAD.neXt.Interfaces.Scripting;

namespace ClientEventReceiver
{
    public class ClientEventReceiver_AUDIO_COM2_MON_LED : IScriptValueProvider
    {
        public double ProvideValue(IApplication app)
        {
            var def = EventSystem.GetDataDefinition("SIMCONNECT:AUDIO COM2 MON LED", SPADDefinitionTypes.CONTROL);
            return (def?.GetValue()).GetValueOrDefault(-1);
        }
    }
}
I do get this error message on SPAD program start now:
No overload for method "GetDataDefinition" takes 2 arguments.
Did the signature of the function "GetDataDefinition" change with this new SPAD .neXt version?

Thanks
Andreas

User avatar
c0nnex
Site Admin
Posts: 5469
Joined: 10 Mar 2015, 21:52
Location: Munich, Germany
Contact:
Status: Offline

Re: Scripting "GetDataDefinition" Function Change

Post by c0nnex » 05 Sep 2017, 21:57

Yes it did.
https://github.com/c0nnex/SPAD.neXt/blo ... tSystem.cs

It only takes one argument now (the name).

ab-tools
Betatester
Posts: 483
Joined: 24 May 2015, 12:02
Location: Munich, Germany
Contact:
Status: Offline

Re: Scripting "GetDataDefinition" Function Change

Post by ab-tools » 06 Sep 2017, 12:06

Thanks, Ulrich, I'll give that a try!

Locked