2018/06/28

Async callback in JS DataSnap Framework

This is a question about a obsessive-compulsive disorder patient. photo from



In the default Datasnap REST application, if there is a specified build of the Sample Methods :

The "echostring" and "ReverseString" two method and corresponding pages are added to the template. By opening the Reversestring template, you can learn that JavaScript is written like this:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
function onReverseStringClick()
{
  if (loginRequired && (AdminInst == null))
  {
    showLogin(true);
    return;
  }
  var valueField = document.getElementById('valueField');
  var s = serverMethods().ReverseString(valueField.value);
  valueField.value = s.result;
}

2018/06/06

Boost Regex and Unicode in C++ Builder

Boost - Bast C++ Library
Because "String" default is unicode in C++ Builer 2009 later.

And same std::wstring.

so, We should to use prefix "w" class, like:
wregex, wsmatch etc.

The Sample code below:

2018/06/01

Delphi Base Class - TProc (CHT)

圖片來源

TProc 在 Delphi 的宣告是:
1
2
3
4
5
TProc = reference to procedure;
TProc<T> = reference to procedure (Arg1: T);
TProc<T1,T2> = reference to procedure (Arg1: T1; Arg2: T2);
TProc<T1,T2,T3> = reference to procedure (Arg1: T1; Arg2: T2; Arg3: T3);
TProc<T1,T2,T3,T4> = reference to procedure (Arg1: T1; Arg2: T2; Arg3: T3; Arg4: T4);


最近在寫測速程式時突然應用到它,我是這麼寫的: