procedure THIVBJScript.SetScript;
var
Code: WideString;
len:integer; /// for inlining StringToOleStr from KOLEdb
Result: OleVariant;
ExcepInfo: TEXCEPINFO;
begin
CreateScriptEngine(TScriptLanguage(_prop_Language));
/// Code := Value;
/// inlining StringToOleStr from KOLEdb
if Value = '' then exit;
len := MultiByteToWideChar(3, MB_PRECOMPOSED, @Value[1], -1, nil, 0);
SetLength(Code, len - 1);
if len <= 1 then exit;
MultiByteToWideChar(3, MB_PRECOMPOSED, @Value[1], -1, @Code[1], len);
/// end of inlining StringToOleStr from KOLEdb
Me := TMe.Create(Self);
AddNamedItem('sys', SCRIPTITEM_ISVISIBLE, Me);
FParser.ParseScriptText(PWideChar(Code), nil, nil, nil, 0, 0, 0, Result, ExcepInfo);
end;
Ответов: 9906
Рейтинг: 351
|
|||
|
|||
карма: 9 |
|