Let me be more specific - here's a function that reads/stores given Short to some shared class variable (TestValue). If there's a value passed down to MyValue function via Lisp, then TestValue carries it down the session. Otherwise, it just returns current TestValue. Here it goes:
<LispFunction("MyValue")> _
Public Shared Function MyValue(ByVal resBuf As ResultBuffer) As Object
Dim m_Result As New ResultBuffer
If resBuf IsNot Nothing Then
Dim m_TypedValue() As TypedValue = resBuf.AsArray
Dim m_Value As Short = CShort(m_TypedValue(0).Value)
If TestValue <> m_Value Then
TestValue = m_Value
End If
End If
m_Result.Add(New TypedValue(5003, TestValue))
Return m_Result
End Function
Now, it's possible to control menu item appearance via DIESEL, e.g.:
$(if,(MyValue),~)Test Item
$(if,$(and,1,$(eval,MyValue)),!.)Test item
Alas, I can't make it work using MyValue Lisp function - somehow DIESEL doesn't evaluate it right. Any ideas on what am I doing wrong here?
Maybe the best solution is to somehow promote my LispFunction to system variable accessible via getvar, but I have no clue if this is possible at all.
Regards,
Maksim Sestic