Discussion (2)1
Log in or sign up to continue

I'm getting an error when I try this but as the documentation explicitly states the default value can be an expression, I don't know if this is a bug in the system or an omission in the documentation?

FWIW using default values would be better than a series of 'assign' statements. 

Looking at the generated code, this is probably not possible.

Each context variable becomes a standard property in an auto-generated context class. The "Default Value" becomes the "InitialExpression" attribute of the property. This means the default is assigned by the underlying object framework upon instantiation of the context object rather than by the BPL engine itself.

Class Test2.NewProcess1.Context Extends Ens.BP.Context [ ClassType = persistent, CompileAfter = Test2.NewProcess1, GeneratedBy = Ens.BPL.Compiler.CLS, ProcedureBlock ]

Property testvar1 As %String(MAXLEN = 50) [ InitialExpression = "blah" ];