mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-22 09:12:19 -05:00
Updated PS..
This commit is contained in:
parent
3e953ae6be
commit
4db2ccf52a
@ -9,6 +9,7 @@
|
|||||||
{$UNDEF PS_FPCSTRINGWORKAROUND}
|
{$UNDEF PS_FPCSTRINGWORKAROUND}
|
||||||
{$DEFINE PS_RESBEFOREPARAMETERS}
|
{$DEFINE PS_RESBEFOREPARAMETERS}
|
||||||
{$DEFINE x64_string_result_as_varparameter}
|
{$DEFINE x64_string_result_as_varparameter}
|
||||||
|
{$DEFINE PS_RESULTFIRST}
|
||||||
{FreePascal 2.3.1 and above has much Delphi compatibility bugs fixed}
|
{FreePascal 2.3.1 and above has much Delphi compatibility bugs fixed}
|
||||||
{$else}
|
{$else}
|
||||||
{$DEFINE FPC_OLD_FIX}
|
{$DEFINE FPC_OLD_FIX}
|
||||||
|
@ -407,9 +407,48 @@
|
|||||||
{$DEFINE 32BIT}
|
{$DEFINE 32BIT}
|
||||||
{$DEFINE CPU32}
|
{$DEFINE CPU32}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
{$ENDIF MSWINDOWS}
|
{$ENDIF MSWINDOWS}
|
||||||
|
|
||||||
|
{ defines for Delphi 2011 }
|
||||||
|
{$IFDEF VER220}
|
||||||
|
{$DEFINE VER140UP}
|
||||||
|
{$DEFINE DELPHI}
|
||||||
|
|
||||||
|
{$DEFINE DELPHI15}
|
||||||
|
{$DEFINE DELPHI1UP}
|
||||||
|
{$DEFINE DELPHI2UP}
|
||||||
|
{$DEFINE DELPHI3UP}
|
||||||
|
{$DEFINE DELPHI4UP}
|
||||||
|
{$DEFINE DELPHI5UP}
|
||||||
|
{$DEFINE DELPHI6UP}
|
||||||
|
{$DEFINE DELPHI7UP}
|
||||||
|
{$DEFINE DELPHI9UP}
|
||||||
|
{$DEFINE DELPHI10UP}
|
||||||
|
{$DEFINE DELPHI11UP}
|
||||||
|
{$DEFINE DELPHI12UP}
|
||||||
|
{$DEFINE DELPHI14UP}
|
||||||
|
{$DEFINE DELPHI15UP}
|
||||||
|
|
||||||
|
{$DEFINE DELPHI2011}
|
||||||
|
{$DEFINE DELPHI2005UP}
|
||||||
|
{$DEFINE DELPHI2006UP}
|
||||||
|
{$DEFINE DELPHI2007UP}
|
||||||
|
{$DEFINE DELPHI2009UP}
|
||||||
|
{$DEFINE DELPHI2010UP}
|
||||||
|
{$DEFINE DELPHI2011UP}
|
||||||
|
{$DEFINE BDS}
|
||||||
|
{$DEFINE BDS8}
|
||||||
|
{$DEFINE BDS3UP}
|
||||||
|
{$DEFINE BDS4UP}
|
||||||
|
{$DEFINE BDS5UP}
|
||||||
|
{$DEFINE BDS6UP}
|
||||||
|
{$DEFINE BDS7UP}
|
||||||
|
{$DEFINE BDS8UP}
|
||||||
|
{$DEFINE 32BIT}
|
||||||
|
{$DEFINE CPU32}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
|
||||||
{ defines for "Delphi for .NET" }
|
{ defines for "Delphi for .NET" }
|
||||||
{$IFDEF CLR}
|
{$IFDEF CLR}
|
||||||
{$DEFINE DOTNET}
|
{$DEFINE DOTNET}
|
||||||
@ -490,4 +529,14 @@
|
|||||||
{$DEFINE DARWIN64}
|
{$DEFINE DARWIN64}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
{$ELSE}
|
||||||
|
{$DEFINE ENDIAN_LITTLE} // To have endianness symbol defined in Delphi too
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$IFDEF DELPHI}
|
||||||
|
{$DEFINE DELPHI_or_MSWINDOWS}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$IFDEF MSWINDOWS}
|
||||||
|
{$DEFINE DELPHI_or_MSWINDOWS}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
@ -2654,9 +2654,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure FinalizeA(var s: tbtString); overload; begin s := ''; end;
|
procedure FinalizeA(var s: tbtString); overload; begin s := ''; end;
|
||||||
|
{$IFNDEF PS_NOWIDESTRING}
|
||||||
procedure FinalizeW(var s: tbtwidestring); overload; begin s := ''; end;
|
procedure FinalizeW(var s: tbtwidestring); overload; begin s := ''; end;
|
||||||
procedure FinalizeU(var s: tbtunicodestring); overload; begin s := ''; end;
|
procedure FinalizeU(var s: tbtunicodestring); overload; begin s := ''; end;
|
||||||
|
{$ENDIF}
|
||||||
procedure FinalizeVariant(var p: TIfRVariant);
|
procedure FinalizeVariant(var p: TIfRVariant);
|
||||||
begin
|
begin
|
||||||
if (p.FType.BaseType = btString) or (p.FType.basetype = btSet) then
|
if (p.FType.BaseType = btString) or (p.FType.basetype = btSet) then
|
||||||
@ -5187,15 +5188,19 @@ begin
|
|||||||
begin
|
begin
|
||||||
Params[c].ExpectedType := GetTypeNo(BlockInfo, Params[c].Val);
|
Params[c].ExpectedType := GetTypeNo(BlockInfo, Params[c].Val);
|
||||||
if PType <> nil then
|
if PType <> nil then
|
||||||
if (Params[c].ExpectedType = nil) or not (Params[c].ExpectedType.BaseType in [btString, btWideString, btUnicodeString, btChar, btWideChar]) then begin
|
if (Params[c].ExpectedType = nil) or not (Params[c].ExpectedType.BaseType in [btString,
|
||||||
|
{$IFNDEF PS_NOWIDESTRING}btWideString, btUnicodeString, btWideChar,{$ENDIF}
|
||||||
|
btChar]) then begin
|
||||||
MakeError('', ecTypeMismatch, '');
|
MakeError('', ecTypeMismatch, '');
|
||||||
Result := False;
|
Result := False;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if Params[c].ExpectedType.BaseType = btChar then
|
if Params[c].ExpectedType.BaseType = btChar then
|
||||||
Params[c].ExpectedType := FindBaseType(btString) else
|
Params[c].ExpectedType := FindBaseType(btString) else
|
||||||
|
{$IFNDEF PS_NOWIDESTRING}
|
||||||
if Params[c].ExpectedType.BaseType = btWideChar then
|
if Params[c].ExpectedType.BaseType = btWideChar then
|
||||||
Params[c].ExpectedType := FindBaseType(btUnicodeString);
|
Params[c].ExpectedType := FindBaseType(btUnicodeString);
|
||||||
|
{$ENDIF}
|
||||||
end else if (PType.BaseType = btArray) and (GetTypeNo(BlockInfo, Params[c].Val).BaseType = btArray) then
|
end else if (PType.BaseType = btArray) and (GetTypeNo(BlockInfo, Params[c].Val).BaseType = btArray) then
|
||||||
begin
|
begin
|
||||||
if TPSArrayType(GetTypeNo(BlockInfo, Params[c].Val)).ArrayTypeNo <> TPSArrayType(PType).ArrayTypeNo then
|
if TPSArrayType(GetTypeNo(BlockInfo, Params[c].Val)).ArrayTypeNo <> TPSArrayType(PType).ArrayTypeNo then
|
||||||
@ -5366,7 +5371,7 @@ function TPSPascalCompiler.ReadString: PIfRVariant;
|
|||||||
temp3 := temp3 + {$IFNDEF PS_NOWIDESTRING}{$IFDEF DELPHI6UP}System.{$IFDEF DELPHI2009UP}UTF8ToWidestring{$ELSE}UTF8Decode{$ENDIF}{$ENDIF}{$ENDIF}(PString(FParser.GetToken));
|
temp3 := temp3 + {$IFNDEF PS_NOWIDESTRING}{$IFDEF DELPHI6UP}System.{$IFDEF DELPHI2009UP}UTF8ToWidestring{$ELSE}UTF8Decode{$ENDIF}{$ENDIF}{$ENDIF}(PString(FParser.GetToken));
|
||||||
{$IFNDEF PS_NOWIDESTRING}wchar:=true;{$ENDIF}
|
{$IFNDEF PS_NOWIDESTRING}wchar:=true;{$ENDIF}
|
||||||
end else
|
end else
|
||||||
temp3 := temp3 + tbtUnicodestring(PString(FParser.GetToken));
|
temp3 := temp3 + {$IFNDEF PS_NOWIDESTRING}tbtUnicodestring{$ENDIF}(PString(FParser.GetToken));
|
||||||
|
|
||||||
FParser.Next;
|
FParser.Next;
|
||||||
if FParser.CurrTokenId = CSTI_String then
|
if FParser.CurrTokenId = CSTI_String then
|
||||||
@ -5562,7 +5567,7 @@ function TPSPascalCompiler.ProcessSub(BlockInfo: TPSBlockInfo): Boolean;
|
|||||||
Temp.ResultType := TPSExternalProcedure(FProcs[ProcNo]).RegProc.Decl.Result;
|
Temp.ResultType := TPSExternalProcedure(FProcs[ProcNo]).RegProc.Decl.Result;
|
||||||
if (Temp.ResultType <> nil) and (Temp.ResultType = FAnyString) then begin // workaround to make the result type match
|
if (Temp.ResultType <> nil) and (Temp.ResultType = FAnyString) then begin // workaround to make the result type match
|
||||||
for i := 0 to Par.Count -1 do begin
|
for i := 0 to Par.Count -1 do begin
|
||||||
if Par[i].ExpectedType.BaseType in [btString, btWideString] then
|
if Par[i].ExpectedType.BaseType in [btString{$IFNDEF PS_NOWIDESTRING}, btWideString{$ENDIF}] then
|
||||||
Temp.ResultType := Par[i].ExpectedType;
|
Temp.ResultType := Par[i].ExpectedType;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -11172,7 +11177,8 @@ var
|
|||||||
TPSProcedure(FProcs[I]).Free;
|
TPSProcedure(FProcs[I]).Free;
|
||||||
FProcs.Free;
|
FProcs.Free;
|
||||||
FProcs := nil;
|
FProcs := nil;
|
||||||
for I := 0 to FTypes.Count - 1 do
|
//reverse free types: a custom type's attribute value type may point to a base type
|
||||||
|
for I := FTypes.Count - 1 downto 0 do
|
||||||
begin
|
begin
|
||||||
PT := FTypes[I];
|
PT := FTypes[I];
|
||||||
pt.Free;
|
pt.Free;
|
||||||
@ -13919,9 +13925,9 @@ begin
|
|||||||
begin
|
begin
|
||||||
case FValue.FType.BaseType of
|
case FValue.FType.BaseType of
|
||||||
btChar: FValue.tchar := (Val+#0)[1];
|
btChar: FValue.tchar := (Val+#0)[1];
|
||||||
btWideChar: FValue.twidechar := WideChar((Val+#0)[1]);
|
|
||||||
btString: tbtString(FValue.tstring) := val;
|
btString: tbtString(FValue.tstring) := val;
|
||||||
{$IFNDEF PS_NOWIDESTRING}
|
{$IFNDEF PS_NOWIDESTRING}
|
||||||
|
btWideChar: FValue.twidechar := WideChar((Val+#0)[1]);
|
||||||
btWideString: tbtwidestring(FValue.twidestring) := tbtwidestring(val);
|
btWideString: tbtwidestring(FValue.twidestring) := tbtwidestring(val);
|
||||||
btUnicodeString: tbtunicodestring(FValue.tunistring) := tbtunicodestring(val);
|
btUnicodeString: tbtunicodestring(FValue.tunistring) := tbtunicodestring(val);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -14840,7 +14846,7 @@ begin
|
|||||||
GetPropInfos(fclass.ClassInfo, p);
|
GetPropInfos(fclass.ClassInfo, p);
|
||||||
for i := Count -1 downto 0 do
|
for i := Count -1 downto 0 do
|
||||||
begin
|
begin
|
||||||
if p^[i]^.PropType^.Kind in [tkLString, tkInteger, tkChar, tkEnumeration, tkFloat, tkString, tkSet, tkClass, tkMethod{$IFNDEF PS_NOWIDESTRING}, tkWString{$ENDIF}] then
|
if p^[i]^.PropType^.Kind in [tkLString, tkInteger, tkChar, tkEnumeration, tkFloat, tkString, tkSet, tkClass, tkMethod{$IFNDEF PS_NOWIDESTRING}, tkWString{$ENDIF}{$IFDEF DELPHI2009UP}, tkUString{$ENDIF}] then
|
||||||
begin
|
begin
|
||||||
if (p^[i]^.GetProc <> nil) then
|
if (p^[i]^.GetProc <> nil) then
|
||||||
begin
|
begin
|
||||||
|
@ -1006,6 +1006,7 @@ begin
|
|||||||
inherited Notification(AComponent, Operation);
|
inherited Notification(AComponent, Operation);
|
||||||
if (Operation = opRemove) and (aComponent is TPSPlugin) then
|
if (Operation = opRemove) and (aComponent is TPSPlugin) then
|
||||||
begin
|
begin
|
||||||
|
if Plugins <> nil then
|
||||||
for i := Plugins.Count -1 downto 0 do
|
for i := Plugins.Count -1 downto 0 do
|
||||||
begin
|
begin
|
||||||
if (Plugins.Items[i] as TPSPluginItem).Plugin = aComponent then
|
if (Plugins.Items[i] as TPSPluginItem).Plugin = aComponent then
|
||||||
|
@ -15,7 +15,7 @@ function UnloadProc(Caller: TPSExec; p: TPSExternalProcRec; Global, Stack: TPSSt
|
|||||||
implementation
|
implementation
|
||||||
uses
|
uses
|
||||||
{$IFDEF UNIX}
|
{$IFDEF UNIX}
|
||||||
LCLIntf, Unix, baseunix, dynlibs, termio, sockets;
|
Unix, baseunix, dynlibs, termio, sockets;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Windows;
|
Windows;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
@ -1537,7 +1537,11 @@ begin
|
|||||||
tkVariant: begin Result := '[Variant]'; exit; end;
|
tkVariant: begin Result := '[Variant]'; exit; end;
|
||||||
{$IFDEF DELPHI6UP}
|
{$IFDEF DELPHI6UP}
|
||||||
{$IFNDEF PS_NOWIDESTRING}
|
{$IFNDEF PS_NOWIDESTRING}
|
||||||
tkWString: begin Result := ''''+tbtString(GetWideStrProp(Instance, pp))+''; end; {$ENDIF}
|
tkWString: begin Result := ''''+tbtString(GetWideStrProp(Instance, pp))+''; end;
|
||||||
|
{$IFDEF DELPHI2009UP}
|
||||||
|
tkUString: begin Result := ''''+tbtUnicodeString(GetUnicodeStrProp(Instance, pp))+''; end;
|
||||||
|
{$ENDIF}
|
||||||
|
{$ENDIF}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
else begin Result := '[Unknown]'; exit; end;
|
else begin Result := '[Unknown]'; exit; end;
|
||||||
end;
|
end;
|
||||||
@ -1599,9 +1603,9 @@ begin
|
|||||||
btS16: str(tbts16(p.dta^), Result);
|
btS16: str(tbts16(p.dta^), Result);
|
||||||
btU32: str(tbtu32(p.dta^), Result);
|
btU32: str(tbtu32(p.dta^), Result);
|
||||||
btS32: str(tbts32(p.dta^), Result);
|
btS32: str(tbts32(p.dta^), Result);
|
||||||
btSingle: result := floattostr(tbtsingle(p.dta^));
|
btSingle: str(tbtsingle(p.dta^), Result);
|
||||||
btDouble: result := floattostr(tbtdouble(p.dta^));
|
btDouble: str(tbtdouble(p.dta^), Result);
|
||||||
btExtended: result := floattostr(tbtextended(p.dta^));
|
btExtended: str(tbtextended(p.dta^), Result);
|
||||||
btString: Result := makestring(tbtString(p.dta^));
|
btString: Result := makestring(tbtString(p.dta^));
|
||||||
btPChar:
|
btPChar:
|
||||||
begin
|
begin
|
||||||
@ -1975,7 +1979,7 @@ end;
|
|||||||
|
|
||||||
class function TPSExec.About: tbtString;
|
class function TPSExec.About: tbtString;
|
||||||
begin
|
begin
|
||||||
Result := 'RemObjects Pascal Script. Copyright (c) 2004-2009 by RemObjects Software';
|
Result := 'RemObjects Pascal Script. Copyright (c) 2004-2010 by RemObjects Software';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPSExec.Cleanup;
|
procedure TPSExec.Cleanup;
|
||||||
@ -8674,24 +8678,26 @@ begin
|
|||||||
1: Stack.SetInt(-1, StrToInt(Stack.GetAnsiString(-2))); // strtoint
|
1: Stack.SetInt(-1, StrToInt(Stack.GetAnsiString(-2))); // strtoint
|
||||||
2: Stack.SetInt(-1, StrToIntDef(Stack.GetAnsiString(-2), Stack.GetInt(-3))); // strtointdef
|
2: Stack.SetInt(-1, StrToIntDef(Stack.GetAnsiString(-2), Stack.GetInt(-3))); // strtointdef
|
||||||
3:
|
3:
|
||||||
|
{$IFNDEF PS_NOWIDESTRING}
|
||||||
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btUnicodeString then
|
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btUnicodeString then
|
||||||
Stack.SetInt(-1, Pos(Stack.GetUnicodeString(-2), Stack.GetUnicodeString(-3)))// pos
|
Stack.SetInt(-1, Pos(Stack.GetUnicodeString(-2), Stack.GetUnicodeString(-3)))// pos
|
||||||
else
|
else
|
||||||
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btWideString then
|
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btWideString then
|
||||||
Stack.SetInt(-1, Pos(Stack.GetWideString(-2), Stack.GetWideString(-3)))// pos
|
Stack.SetInt(-1, Pos(Stack.GetWideString(-2), Stack.GetWideString(-3)))// pos
|
||||||
else
|
else{$ENDIF}
|
||||||
Stack.SetInt(-1, Pos(Stack.GetAnsiString(-2), Stack.GetAnsiString(-3)));// pos
|
Stack.SetInt(-1, Pos(Stack.GetAnsiString(-2), Stack.GetAnsiString(-3)));// pos
|
||||||
4:
|
4:
|
||||||
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btWideString then
|
{$IFNDEF PS_NOWIDESTRING} if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btWideString then
|
||||||
Stack.SetWideString(-1, Copy(Stack.GetWideString(-2), Stack.GetInt(-3), Stack.GetInt(-4))) // copy
|
Stack.SetWideString(-1, Copy(Stack.GetWideString(-2), Stack.GetInt(-3), Stack.GetInt(-4))) // copy
|
||||||
else
|
else
|
||||||
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btUnicodeString then
|
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btUnicodeString then
|
||||||
Stack.SetUnicodeString(-1, Copy(Stack.GetUnicodeString(-2), Stack.GetInt(-3), Stack.GetInt(-4))) // copy
|
Stack.SetUnicodeString(-1, Copy(Stack.GetUnicodeString(-2), Stack.GetInt(-3), Stack.GetInt(-4))) // copy
|
||||||
else
|
else{$ENDIF}
|
||||||
Stack.SetAnsiString(-1, Copy(Stack.GetAnsiString(-2), Stack.GetInt(-3), Stack.GetInt(-4))); // copy
|
Stack.SetAnsiString(-1, Copy(Stack.GetAnsiString(-2), Stack.GetInt(-3), Stack.GetInt(-4))); // copy
|
||||||
5: //delete
|
5: //delete
|
||||||
begin
|
begin
|
||||||
temp := NewTPSVariantIFC(Stack[Stack.Count -1], True);
|
temp := NewTPSVariantIFC(Stack[Stack.Count -1], True);
|
||||||
|
{$IFNDEF PS_NOWIDESTRING}
|
||||||
if (temp.Dta <> nil) and (temp.aType.BaseType = btUnicodeString) then
|
if (temp.Dta <> nil) and (temp.aType.BaseType = btUnicodeString) then
|
||||||
begin
|
begin
|
||||||
Delete(tbtUnicodeString(temp.Dta^), Stack.GetInt(-2), Stack.GetInt(-3));
|
Delete(tbtUnicodeString(temp.Dta^), Stack.GetInt(-2), Stack.GetInt(-3));
|
||||||
@ -8699,7 +8705,7 @@ begin
|
|||||||
if (temp.Dta <> nil) and (temp.aType.BaseType = btWideString) then
|
if (temp.Dta <> nil) and (temp.aType.BaseType = btWideString) then
|
||||||
begin
|
begin
|
||||||
Delete(tbtwidestring(temp.Dta^), Stack.GetInt(-2), Stack.GetInt(-3));
|
Delete(tbtwidestring(temp.Dta^), Stack.GetInt(-2), Stack.GetInt(-3));
|
||||||
end else begin
|
end else {$ENDIF} begin
|
||||||
if (temp.Dta = nil) or (temp.aType.BaseType <> btString) then
|
if (temp.Dta = nil) or (temp.aType.BaseType <> btString) then
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
@ -8711,11 +8717,12 @@ begin
|
|||||||
6: // insert
|
6: // insert
|
||||||
begin
|
begin
|
||||||
temp := NewTPSVariantIFC(Stack[Stack.Count -2], True);
|
temp := NewTPSVariantIFC(Stack[Stack.Count -2], True);
|
||||||
|
{$IFNDEF PS_NOWIDESTRING}
|
||||||
if (temp.Dta <> nil) and (temp.aType.BaseType = btUnicodeString) then begin
|
if (temp.Dta <> nil) and (temp.aType.BaseType = btUnicodeString) then begin
|
||||||
Insert(Stack.GetUnicodeString(-1), tbtUnicodeString(temp.Dta^), Stack.GetInt(-3));
|
Insert(Stack.GetUnicodeString(-1), tbtUnicodeString(temp.Dta^), Stack.GetInt(-3));
|
||||||
end else if (temp.Dta <> nil) and (temp.aType.BaseType = btWideString) then begin
|
end else if (temp.Dta <> nil) and (temp.aType.BaseType = btWideString) then begin
|
||||||
Insert(Stack.GetWideString(-1), tbtwidestring(temp.Dta^), Stack.GetInt(-3));
|
Insert(Stack.GetWideString(-1), tbtwidestring(temp.Dta^), Stack.GetInt(-3));
|
||||||
end else begin
|
end else {$ENDIF} begin
|
||||||
if (temp.Dta = nil) or (temp.aType.BaseType <> btString) then
|
if (temp.Dta = nil) or (temp.aType.BaseType <> btString) then
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
@ -8759,6 +8766,7 @@ begin
|
|||||||
tbtstring(temp.Dta^)[i] := tbtchar(Stack.GetInt(-1));
|
tbtstring(temp.Dta^)[i] := tbtchar(Stack.GetInt(-1));
|
||||||
end;
|
end;
|
||||||
10:
|
10:
|
||||||
|
{$IFNDEF PS_NOWIDESTRING}
|
||||||
{$IFDEF DELPHI2009UP}
|
{$IFDEF DELPHI2009UP}
|
||||||
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btUnicodeString then
|
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btUnicodeString then
|
||||||
Stack.SetUnicodeString(-1, UpperCase(Stack.GetUnicodeString(-2))) // Uppercase
|
Stack.SetUnicodeString(-1, UpperCase(Stack.GetUnicodeString(-2))) // Uppercase
|
||||||
@ -8768,8 +8776,10 @@ begin
|
|||||||
(Stack.GetItem(Stack.Count -2)^.FType.BaseType = btUnicodeString) then
|
(Stack.GetItem(Stack.Count -2)^.FType.BaseType = btUnicodeString) then
|
||||||
Stack.SetWideString(-1, WideUpperCase(Stack.GetWideString(-2))) // Uppercase
|
Stack.SetWideString(-1, WideUpperCase(Stack.GetWideString(-2))) // Uppercase
|
||||||
else
|
else
|
||||||
|
{$ENDIF}
|
||||||
Stack.SetAnsiString(-1, FastUppercase(Stack.GetAnsiString(-2))); // Uppercase
|
Stack.SetAnsiString(-1, FastUppercase(Stack.GetAnsiString(-2))); // Uppercase
|
||||||
11:
|
11:
|
||||||
|
{$IFNDEF PS_NOWIDESTRING}
|
||||||
{$IFDEF DELPHI2009UP}
|
{$IFDEF DELPHI2009UP}
|
||||||
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btUnicodeString then
|
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btUnicodeString then
|
||||||
Stack.SetUnicodeString(-1, LowerCase(Stack.GetUnicodeString(-2))) // Uppercase
|
Stack.SetUnicodeString(-1, LowerCase(Stack.GetUnicodeString(-2))) // Uppercase
|
||||||
@ -8779,14 +8789,17 @@ begin
|
|||||||
(Stack.GetItem(Stack.Count -2)^.FType.BaseType = btUnicodeString) then
|
(Stack.GetItem(Stack.Count -2)^.FType.BaseType = btUnicodeString) then
|
||||||
Stack.SetWideString(-1, WideLowerCase(Stack.GetWideString(-2))) // Uppercase
|
Stack.SetWideString(-1, WideLowerCase(Stack.GetWideString(-2))) // Uppercase
|
||||||
else
|
else
|
||||||
|
{$ENDIF}
|
||||||
Stack.SetAnsiString(-1, FastLowercase(Stack.GetAnsiString(-2)));// LowerCase
|
Stack.SetAnsiString(-1, FastLowercase(Stack.GetAnsiString(-2)));// LowerCase
|
||||||
12:
|
12:
|
||||||
|
{$IFNDEF PS_NOWIDESTRING}
|
||||||
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btUnicodeString then
|
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btUnicodeString then
|
||||||
Stack.SetUnicodeString(-1, SysUtils.Trim(Stack.GetUnicodestring(-2))) // Uppercase
|
Stack.SetUnicodeString(-1, SysUtils.Trim(Stack.GetUnicodestring(-2))) // Uppercase
|
||||||
else if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btWideString then
|
else if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btWideString then
|
||||||
Stack.SetWideString(-1, SysUtils.Trim(Stack.GetWideString(-2))) // Uppercase
|
Stack.SetWideString(-1, SysUtils.Trim(Stack.GetWideString(-2))) // Uppercase
|
||||||
else
|
else
|
||||||
Stack.SetAnsiString(-1, Trim(Stack.GetAnsiString(-2)));// Trim
|
{$ENDIF}
|
||||||
|
Stack.SetAnsiString(-1, SysUtils.Trim(Stack.GetAnsiString(-2)));// Trim
|
||||||
13: Stack.SetInt(-1, Length(Stack.GetAnsiString(-2))); // Length
|
13: Stack.SetInt(-1, Length(Stack.GetAnsiString(-2))); // Length
|
||||||
14: // SetLength
|
14: // SetLength
|
||||||
begin
|
begin
|
||||||
@ -8809,28 +8822,31 @@ begin
|
|||||||
23: Stack.SetReal(-1, StrToFloat(Stack.GetAnsiString(-2))); // StrToFloat
|
23: Stack.SetReal(-1, StrToFloat(Stack.GetAnsiString(-2))); // StrToFloat
|
||||||
24: Stack.SetAnsiString(-1, FloatToStr(Stack.GetReal(-2)));// FloatToStr
|
24: Stack.SetAnsiString(-1, FloatToStr(Stack.GetReal(-2)));// FloatToStr
|
||||||
25:
|
25:
|
||||||
|
{$IFNDEF PS_NOWIDESTRING}
|
||||||
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btUnicodeString then
|
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btUnicodeString then
|
||||||
Stack.SetUnicodeString(-1, upadL(Stack.GetUnicodeString(-2), Stack.GetInt(-3))) // PadL
|
Stack.SetUnicodeString(-1, upadL(Stack.GetUnicodeString(-2), Stack.GetInt(-3))) // PadL
|
||||||
else
|
else
|
||||||
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btWideString then
|
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btWideString then
|
||||||
Stack.SetWideString(-1, wPadL(Stack.GetWideString(-2), Stack.GetInt(-3))) // PadL
|
Stack.SetWideString(-1, wPadL(Stack.GetWideString(-2), Stack.GetInt(-3))) // PadL
|
||||||
else
|
else{$ENDIF}
|
||||||
Stack.SetAnsiString(-1, PadL(Stack.GetAnsiString(-2), Stack.GetInt(-3))); // PadL
|
Stack.SetAnsiString(-1, PadL(Stack.GetAnsiString(-2), Stack.GetInt(-3))); // PadL
|
||||||
26:
|
26:
|
||||||
|
{$IFNDEF PS_NOWIDESTRING}
|
||||||
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btUnicodeString then
|
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btUnicodeString then
|
||||||
Stack.SetUnicodeString(-1, uPadR(Stack.GetUnicodeString(-2), Stack.GetInt(-3))) // PadR
|
Stack.SetUnicodeString(-1, uPadR(Stack.GetUnicodeString(-2), Stack.GetInt(-3))) // PadR
|
||||||
else
|
else
|
||||||
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btWideString then
|
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btWideString then
|
||||||
Stack.SetWideString(-1, wPadR(Stack.GetWideString(-2), Stack.GetInt(-3))) // PadR
|
Stack.SetWideString(-1, wPadR(Stack.GetWideString(-2), Stack.GetInt(-3))) // PadR
|
||||||
else
|
else{$ENDIF}
|
||||||
Stack.SetAnsiString(-1, PadR(Stack.GetAnsiString(-2), Stack.GetInt(-3))); // PadR
|
Stack.SetAnsiString(-1, PadR(Stack.GetAnsiString(-2), Stack.GetInt(-3))); // PadR
|
||||||
27:
|
27:
|
||||||
|
{$IFNDEF PS_NOWIDESTRING}
|
||||||
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btUnicodeString then
|
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btUnicodeString then
|
||||||
Stack.SetUnicodeString(-1, uPadZ(Stack.GetUnicodeString(-2), Stack.GetInt(-3)))// PadZ
|
Stack.SetUnicodeString(-1, uPadZ(Stack.GetUnicodeString(-2), Stack.GetInt(-3)))// PadZ
|
||||||
else
|
else
|
||||||
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btWideString then
|
if Stack.GetItem(Stack.Count -2)^.FType.BaseType = btWideString then
|
||||||
Stack.SetWideString(-1, wPadZ(Stack.GetWideString(-2), Stack.GetInt(-3)))// PadZ
|
Stack.SetWideString(-1, wPadZ(Stack.GetWideString(-2), Stack.GetInt(-3)))// PadZ
|
||||||
else
|
else{$ENDIF}
|
||||||
Stack.SetAnsiString(-1, PadZ(Stack.GetAnsiString(-2), Stack.GetInt(-3)));// PadZ
|
Stack.SetAnsiString(-1, PadZ(Stack.GetAnsiString(-2), Stack.GetInt(-3)));// PadZ
|
||||||
28: Stack.SetAnsiString(-1, StringOfChar(tbtChar(Stack.GetInt(-2)), Stack.GetInt(-3))); // Replicate/StrOfChar
|
28: Stack.SetAnsiString(-1, StringOfChar(tbtChar(Stack.GetInt(-2)), Stack.GetInt(-3))); // Replicate/StrOfChar
|
||||||
29: // Assigned
|
29: // Assigned
|
||||||
@ -12105,6 +12121,7 @@ begin
|
|||||||
Result := PSGetUInt(@PPSVariantData(val).Data, val.FType);
|
Result := PSGetUInt(@PPSVariantData(val).Data, val.FType);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IFNDEF PS_NOWIDESTRING}
|
||||||
function TPSStack.GetUnicodeString(ItemNo: Integer): tbtunicodestring;
|
function TPSStack.GetUnicodeString(ItemNo: Integer): tbtunicodestring;
|
||||||
var
|
var
|
||||||
val: PPSVariant;
|
val: PPSVariant;
|
||||||
@ -12116,7 +12133,6 @@ begin
|
|||||||
Result := PSGetUnicodeString(@PPSVariantData(val).Data, val.FType);
|
Result := PSGetUnicodeString(@PPSVariantData(val).Data, val.FType);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$IFNDEF PS_NOWIDESTRING}
|
|
||||||
function TPSStack.GetWideString(ItemNo: Longint): tbtWideString;
|
function TPSStack.GetWideString(ItemNo: Longint): tbtWideString;
|
||||||
var
|
var
|
||||||
val: PPSVariant;
|
val: PPSVariant;
|
||||||
|
Loading…
Reference in New Issue
Block a user