I have a C# assembly that is calling a PowerBuilder.NET(12.1 Build 7217) assembly. The PowerBuilder source code is contained below, you can see it is a rather simple true/false evaluation of a string.
When the PB.NET assembly is called by a Window in C#, it returns the expected result of "true". When the same code is called by a C# assembly, the code returns "", or an empty string.
I have managed to narrow the problem down to the DataStore interactions in the PB.NET assembly. If the PB.NET assembly is called from another assembly, the DataStore always has 0 rows and contains only empty strings. Has anyone seen or dealt with this before?
// Create instance of Datastore
ldsExpression = CREATE DataStore
// Set data object
ldsExpression.DataObject = "d_condition_expression"
//// Setting datawindow expression
lsExpression = 'condition_expression.expression = ~"' + asConditionExpression + '~"'
//// Apply Expression
lsError = ldsExpression.Modify(lsExpression)
IF len(lsError) = 0 THEN ldsExpression.InsertRow(0)
//get the result
lsResult = ldsExpression.GetItemString(1,"condition_expression")
lsResult = lsError
// Destroy instance of ldsExpression