Basic syntax
- Last UpdatedApr 24, 2025
- 2 minute read
This section describes some of the Visual Basic (VB) syntax that can be used for Application Calculation Engine (ACE) programming. In later versions of ACE, other languages such as C# are also available for scripting, but they will not be discussed here.
All Application Calculation Engine (ACE) user code, whether it be C# or Visual Basic (VB), is embedded in a procedure inside a class. When editing in simple mode, this wrapping code is never seen. As a result, certain statements do not make sense in the user code. Simple mode can be cleared in the View Menu of the Editor, allowing the full code to be viewed and all keywords made available for use.
The wrapping code (shown below) is there so that the ACE programmer does not have to be concerned about namespaces, classes, and so on.
Imports System
Imports OASySDNA.Realtime.HighPerformanceDB
Imports OASySDNA.Realtime.HighPerformanceSetDB
Imports OASySDNA.Realtime.ACE
Imports OASySDNA.Realtime
Imports OASySDNA.Common
Imports OASySDNA.Common.Config
Imports OASySDNA.Common.PubSub
Imports System.Runtime.InteropServices
Imports System.Collections
Imports System.Globalization
Imports System.Text
namespace OASySDNA.Realtime.ACE
Public Class ACE_MyProcedure Inherits ACEProcedure
Public Overrides Function Run(args As ACEParameter(), values As Double(), runBecauseGoingHot As Boolean) As Double
Dim input1 As Double = values(1)
Dim input2 As Double = values(2)
Dim input3 As Double = values(3)
Dim input4 As Double = values(4)
Dim input5 As Double = values(5)
Dim input6 As Double = values(6)
Dim input7 As Double = values(7)
Dim input8 As Double = values(8)
Dim input9 As Double = values(9)
Dim input10 As Double = values(10)
Dim input11 As Double = values(11)
Dim input12 As Double = values(12)
Dim input13 As Double = values(13)
Dim input14 As Double = values(14)
Dim input15 As Double = values(15)
Dim input16 As Double = values(16)
As a result of how the code is wrapped, the following keywords are not allowed:
-
Module
-
Class
-
Function
-
Sub
-
Private
-
Public
-
Namespace
-
Imports
-
End
-
Return
Note: Any keywords that are illegal result in a syntax error when compiled. The ACE also does not allow the use of the word "Static" as it causes strange behavior when compiled in-memory.