Sub TwiceStrCB(ByVal ExprPartPtr As IntPtr)
Dim ExprPart As New uCalc.Callback(ExprPartPtr)
ExprPart.ReturnStr(ExprPart.ArgStr(1) + ExprPart.ArgStr(1))
End Sub
Sub TwiceStr()
uc.DefineFunction("Twice(Txt As String) As String", uc.PinAddr(AddressOf TwiceStrCB))
Console.WriteLine(uc.EvalStr("Twice('Ha')")) ' Returns "HaHa"
End Sub
static void TwiceStrCB(IntPtr ExprPartPtr) {
var ExprPart = New uCalc.Callback(ExprPartPtr);
ExprPart.ReturnStr(ExprPart.ArgStr(1) + ExprPart.ArgStr(1));
}
static void TwiceStr() {
uc.DefineFunction("Twice(Txt As String) As String", uc.PinAddr(TwiceStrCB));
Console.WriteLine(uc.EvalStr("Twice('Ha')")); // Returns "HaHa";
}
procedure TwiceStrCB(ExprPartPtr: System.Pointer);
begin
//var ExprPart: uCalc.CreateCallback(ExprPartPtr);
ExprPart.ReturnStr(ExprPart.ArgStr(1) + ExprPart.ArgStr(1));
End;
procedure TwiceStr();
begin
uc.DefineFunction('Twice(Txt As String) As String', TwiceStrCB);
WriteLn(uc.EvalStr('Twice("Ha")')); // Returns 'HaHa';
End;
void _stdcall TwiceStrCB(uCalcPtr ExprPartPtr) {
auto ExprPart = uCalc::Callback(ExprPartPtr);
ExprPart.ReturnStr(ExprPart.ArgStr(1) + ExprPart.ArgStr(1));
}
void TwiceStr() {
uc.DefineFunction("Twice(Txt As String) As String", TwiceStrCB);
cout << uc.EvalStr("Twice('Ha')") << endl; // Returns "HaHa";
}
static void TwiceStrCB(uCalcPtr ExprPartPtr) {
auto ExprPart = uCalc::Callback(ExprPartPtr);
ExprPart.ReturnStr(ExprPart.ArgStr(1) + ExprPart.ArgStr(1));
}
static void TwiceStr() {
uc.DefineFunction("Twice(Txt As String) As String", ucPinAddr(TwiceStrCB));
Console::WriteLine(uc.EvalStr("Twice('Ha')")); // Returns "HaHa";
}
<DllImport(uCalcDLL, CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.Cdecl, EntryPoint:="ReturnStr")> _
Private Sub ReturnStr__(ByVal ExprPartHandle As IntPtr,ByVal Value As String)
End Sub
[DllImport(uCalcDLL, CharSet=CharSet.Ansi, CallingConvention=CallingConvention.Cdecl, EntryPoint="ReturnStr")]
protected static extern void ReturnStr_(IntPtr ExprPartHandle, string Value);
{DLLImport}procedure ReturnStr__(ExprPartHandle: System.Pointer;Value: AnsiString); cdecl; external uCalcDLL name 'ReturnStr';
typedef void (* __ReturnStr)(void *ExprPartHandle, CONSTCHAR Value );
[DllImport(uCalcLib, CharSet=CharSet::Ansi, CallingConvention=CallingConvention::Cdecl, EntryPoint = "ReturnStr")]
static void ReturnStr_(void * ExprPartHandle, MARSHALSTR Value);