diff --git a/Projects/PStest/project1.lpi b/Projects/PStest/project1.lpi
index 9b1a215..5f97d85 100644
--- a/Projects/PStest/project1.lpi
+++ b/Projects/PStest/project1.lpi
@@ -8,10 +8,10 @@
-
+
-
+
@@ -35,7 +35,12 @@
-
+
+
+
+
+
+
@@ -43,121 +48,123 @@
-
-
+
-
+
+
+
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
-
+
-
+
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
+
-
-
-
-
+
+
+
+
+
-
-
+
@@ -186,6 +193,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Projects/PStest/project1.rc b/Projects/PStest/project1.rc
new file mode 100644
index 0000000..ba97e3e
--- /dev/null
+++ b/Projects/PStest/project1.rc
@@ -0,0 +1,6 @@
+#define RT_MANIFEST 24
+#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
+#define ISOLATIONAWARE_MANIFEST_RESOURCE_ID 2
+#define ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID 3
+
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "project1.manifest"
diff --git a/Projects/PStest/testps.pas b/Projects/PStest/testps.pas
index 34da04e..a1e0f71 100644
--- a/Projects/PStest/testps.pas
+++ b/Projects/PStest/testps.pas
@@ -13,15 +13,15 @@ type
x, y:integer;
end;
- function MakeArr : TStringArray;
-procedure TestParameters(Int1,Int2,Int3,Int4,Int5,Int6 : integer);
-function TestResult(Int1,Int2,Int3,Int4,Int5,Int6 : integer): Integer;
-function TestString(Str1,Str2,Str3 : string) : string;
-function TestStringEdit(var Str : string) : String;
-procedure TestArrayPassing( Arr : TStringArray);
-Procedure TestArrayEdit(var Arr : TStringArray);
-function TestArrayFull(var Arr1: TStringArray; Arr2 : TStringArray): TStringArray;
-function makePoint(x, y: integer): w_Tpoint;
+function MakeArr : TStringArray; safecall;
+procedure TestParameters(Int1,Int2,Int3,Int4,Int5,Int6 : integer); safecall;
+function TestResult(Int1,Int2,Int3,Int4,Int5,Int6 : integer): Integer; safecall;
+function TestString(Str1,Str2,Str3 : string) : string; safecall;
+function TestStringEdit(var Str : string) : String; safecall;
+procedure TestArrayPassing( Arr : TStringArray); safecall;
+Procedure TestArrayEdit(var Arr : TStringArray); safecall;
+function TestArrayFull(var Arr1: TStringArray; Arr2 : TStringArray): TStringArray; safecall;
+function makePoint(x, y: integer): w_Tpoint; safecall;
implementation
@@ -33,7 +33,7 @@ begin;
Form1.Memo2.Lines.add(s);
end;
-procedure TestParameters(Int1,Int2,Int3,Int4,Int5,Int6 : integer);
+procedure TestParameters(Int1,Int2,Int3,Int4,Int5,Int6 : integer); safecall;
begin;
Writeln('Parameters are: ' + format('%d %d %d %d %d %d',[int1,int2,int3,int4,int5,int6]));
if (int1 <> 1) or (int2 <> 2) or (int3 <> 3) or (int4 <> 4) or (int5 <> 5) or (int6 <> 6) then
@@ -42,13 +42,13 @@ begin;
Writeln('Passed this test');
end;
-function TestResult(Int1,Int2,Int3,Int4,Int5,Int6 : integer): Integer;
+function TestResult(Int1,Int2,Int3,Int4,Int5,Int6 : integer): Integer; safecall;
begin;
Result := int1 + int2 + int3 + int4 + int5 + int6;
Writeln('Result should be:' + inttostr(int1+int2+int3+int4+int5+int6));
end;
-function TestString(Str1,Str2,Str3 : string) : string;
+function TestString(Str1,Str2,Str3 : string) : string; safecall;
begin;
if Str1+Str2+str3 = 'lol' then
Writeln('Strings got passed over correctly.');
@@ -59,7 +59,7 @@ begin;
Writeln('Result should be a');
end;
-function TestStringEdit(var Str : string) : String;
+function TestStringEdit(var Str : string) : String; safecall;
begin;
Result := 'False';
if Str <> 'Test' then
@@ -70,7 +70,7 @@ begin;
Writeln('Result should be: hopla; Input str should be tseT');
end;
-procedure TestArrayPassing(Arr : TStringArray);
+procedure TestArrayPassing(Arr : TStringArray); safecall;
var
i : integer;
begin;
@@ -80,7 +80,7 @@ begin;
end;
-Procedure TestArrayEdit(var Arr : TStringArray);
+Procedure TestArrayEdit(var Arr : TStringArray); safecall;
begin;
Writeln('Arr size is ' + inttostr(length(arr)));
SetLength(arr,0);
@@ -92,7 +92,7 @@ begin;
arr[4] := '!';
end;
-function ConvStrArr( Arr : Array of String): TStringArray;
+function ConvStrArr( Arr : Array of String): TStringArray; safecall;
var
Len : Integer;
begin;
@@ -101,7 +101,7 @@ begin;
Move(Arr[Low(Arr)], Result[0], Len*SizeOf(String));
end;
-function TestArrayFull(var Arr1: TStringArray; Arr2 : TStringArray): TStringArray;
+function TestArrayFull(var Arr1: TStringArray; Arr2 : TStringArray): TStringArray; safecall;
begin
Writeln(Format('Len(Arr1) = %d - Len(Arr2) = %d',[Length(Arr1),length(arr2)]));
SetLength(Result,0);
@@ -115,14 +115,14 @@ begin
Result := ConvStrArr(['Waza?','Gaat','Alles','Goed']);
end;
-function MakeArr : TStringArray;
+function MakeArr : TStringArray; safecall;
begin;
setlength(result,2);
result[0] := 'Test0';
Result[1] := 'Wow!';
end;
-function makePoint(x, y: integer): w_Tpoint;
+function makePoint(x, y: integer): w_Tpoint; safecall;
begin
result.x := x;
result.y := y;
diff --git a/Projects/PStest/unit1.lfm b/Projects/PStest/unit1.lfm
index da8adc7..a6b82e0 100644
--- a/Projects/PStest/unit1.lfm
+++ b/Projects/PStest/unit1.lfm
@@ -1,19 +1,20 @@
object Form1: TForm1
- Left = 347
- Height = 300
- Top = 314
- Width = 400
+ Left = 237
+ Height = 302
+ Top = 312
+ Width = 536
ActiveControl = Button1
Caption = 'Bug in Pascal Script for Lazarus'
- ClientHeight = 300
- ClientWidth = 400
+ ClientHeight = 302
+ ClientWidth = 536
LCLVersion = '0.9.29'
object Memo1: TMemo
Left = 0
- Height = 137
+ Height = 139
Top = 55
- Width = 400
+ Width = 536
Align = alBottom
+ Anchors = [akTop, akLeft, akRight, akBottom]
Lines.Strings = (
'program TestPS;'
''
@@ -66,7 +67,7 @@ object Form1: TForm1
' for i := 0 to high(arr1) do'
' Writeln(arr1[i]);'
' Writeln('''');'
- ' Writeln(''Should writeln: Ik ben een geest!'');'
+ ' Writeln(''Should writeln: Testing!'');'
' for i := 0 to high(arr2) do'
' writeln(arr2[i]);'
' writeln('''');'
@@ -77,13 +78,15 @@ object Form1: TForm1
'end.'
)
OnChange = Memo1Change
+ ScrollBars = ssAutoBoth
TabOrder = 0
+ WordWrap = False
end
object Memo2: TMemo
Left = 0
Height = 108
- Top = 192
- Width = 400
+ Top = 194
+ Width = 536
Align = alBottom
TabOrder = 1
end
@@ -91,8 +94,9 @@ object Form1: TForm1
Left = 0
Height = 55
Top = 0
- Width = 400
- Align = alClient
+ Width = 536
+ Align = alCustom
+ Anchors = [akTop, akLeft, akRight]
Caption = 'Compile'
OnClick = Button1Click
TabOrder = 2
diff --git a/Projects/PStest/unit1.lrs b/Projects/PStest/unit1.lrs
index 4947017..2c6db81 100644
--- a/Projects/PStest/unit1.lrs
+++ b/Projects/PStest/unit1.lrs
@@ -1,43 +1,45 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TForm1','FORMDATA',[
- 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'['#1#6'Height'#3','#1#3'Top'#3':'#1#5'Wid'
- +'th'#3#144#1#13'ActiveControl'#7#7'Button1'#7'Caption'#6' Bug in Pascal Scri'
- +'pt for Lazarus'#12'ClientHeight'#3','#1#11'ClientWidth'#3#144#1#10'LCLVersi'
- +'on'#6#6'0.9.29'#0#5'TMemo'#5'Memo1'#4'Left'#2#0#6'Height'#3#137#0#3'Top'#2
- +'7'#5'Width'#3#144#1#5'Align'#7#8'alBottom'#13'Lines.Strings'#1#6#15'program'
- +' TestPS;'#6#0#6#3'var'#6#30' Str,Str1,str2,str3 : String;'#6'$ Arr,Arr1,A'
- +'rr2,Arr3 : TStringArray;'#6#14' I : integer;'#6#14' p: w_TPoint;'#6#5'beg'
- +'in'#6#30' TestParameters(1,2,3,4,5,6);'#6'1 if TestResult(1,2,3,4,5,6) = '
- +'(1+2+3+4+5+6) then'#6'M Writeln(''Result = '' + inttostr(1+2+3+4+5+6) + '
- +'''. Passed the result test'')'#6#6' else'#6'> Writeln(''Result = '' + '
- +'Inttostr(TestResult(1,2,3,4,5,6)) +'#6#31' ''. Failed @ result test'');'
- +#6#22' p := makePoint(2,2);'#6'8 writeln(''p: '' + inttostr(p.x) + '', '' '
- +'+ inttostr(p.y));'#6#14' Str1 := ''l'';'#6#14' Str2 := ''o'';'#6#14' Str'
- +'3 := ''l'';'#6'* if TestString(Str1,Str2,Str3) = ''a'' then'#6'% Writel'
- +'n(''String test succesful.'')'#6#6' else'#6'# Writeln(''String test fai'
- +'led.'');'#6'8 if (str1 = ''l'') and (str2 = ''o'') and (str3 = ''l'') then'
- +#6'( Writeln(''String test passed again.'')'#6#6' else'#6'# Writeln('
- +'''String test failed.'');'#6#16' Str := ''Test'';'#6''' if TestStringEdit'
- +'(Str) = ''hopla'' then'#6', Writeln(''TestStringEdit result passed.'')'#6
- +#6' else'#6'- Writeln(''TestStringEdit result failed.'');'#6#22' if Str'
- +' = ''tseT'' then'#6'+ Writeln(''TestStringEdit input passed.'')'#6#6' e'
- +'lse'#6', Writeln(''TestStringEdit input failed.'');'#6#21' TestArrayEdi'
- +'t(Arr);'#6'" For i := 0 to Length(arr) - 1 do'#6#20' Writeln(Arr[i]);'#6
- +'* Writeln(''it shouldve written: "abcd!"'');'#6'1 Arr := TStringArray(['''
- +'Dit'',''is'',''een'',''test'']);'#6#24' TestArrayPassing(arr);'#6'< TestA'
- +'rrayPassing(TStringArray([''Dit'',''is'',''een'',''test'']));'#6'& Arr1 :='
- +' TStringArray([''W'',''a'',''t'']);'#6'- Arr2 := TStringArray([''T'',''es'
- +''',''t'',''ing'']);'#6''' Arr3 := TStringArray([''Wowing'',''!'']);'#6'# '
- +'Arr3 := TestArrayFull(Arr1,Arr2);'#6'/ Writeln(''Should writeln: Hoi Hoe G'
- +'aat Het?'');'#6#29' for i := 0 to high(arr1) do'#6#21' Writeln(arr1[i])'
- +';'#6#14' Writeln('''');'#6'/ Writeln(''Should writeln: Ik ben een geest!'
- +''');'#6#29' for i := 0 to high(arr2) do'#6#20' writeln(arr2[i]);'#6#14' '
- +' writeln('''');'#6'3 Writeln(''Should writeln: Waza? Gaat alles goed'');'#6
- +#29' for I := 0 to high(arr3) do'#6#21' Writeln(arr3[i]);'#6#0#6#4'end.'
- +#0#8'OnChange'#7#11'Memo1Change'#8'TabOrder'#2#0#0#0#5'TMemo'#5'Memo2'#4'Lef'
- +'t'#2#0#6'Height'#2'l'#3'Top'#3#192#0#5'Width'#3#144#1#5'Align'#7#8'alBottom'
- +#8'TabOrder'#2#1#0#0#7'TButton'#7'Button1'#4'Left'#2#0#6'Height'#2'7'#3'Top'
- +#2#0#5'Width'#3#144#1#5'Align'#7#8'alClient'#7'Caption'#6#7'Compile'#7'OnCli'
- +'ck'#7#12'Button1Click'#8'TabOrder'#2#2#0#0#0
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#237#0#6'Height'#3'.'#1#3'Top'#3'8'#1#5'Wi'
+ +'dth'#3#24#2#13'ActiveControl'#7#7'Button1'#7'Caption'#6' Bug in Pascal Scri'
+ +'pt for Lazarus'#12'ClientHeight'#3'.'#1#11'ClientWidth'#3#24#2#10'LCLVersio'
+ +'n'#6#6'0.9.29'#0#5'TMemo'#5'Memo1'#4'Left'#2#0#6'Height'#3#139#0#3'Top'#2'7'
+ +#5'Width'#3#24#2#5'Align'#7#8'alBottom'#7'Anchors'#11#5'akTop'#6'akLeft'#7'a'
+ +'kRight'#8'akBottom'#0#13'Lines.Strings'#1#6#15'program TestPS;'#6#0#6#3'var'
+ +#6#30' Str,Str1,str2,str3 : String;'#6'$ Arr,Arr1,Arr2,Arr3 : TStringArray'
+ +';'#6#14' I : integer;'#6#14' p: w_TPoint;'#6#5'begin'#6#30' TestParamete'
+ +'rs(1,2,3,4,5,6);'#6'1 if TestResult(1,2,3,4,5,6) = (1+2+3+4+5+6) then'#6'M'
+ +' Writeln(''Result = '' + inttostr(1+2+3+4+5+6) + ''. Passed the result t'
+ +'est'')'#6#6' else'#6'> Writeln(''Result = '' + Inttostr(TestResult(1,2'
+ +',3,4,5,6)) +'#6#31' ''. Failed @ result test'');'#6#22' p := makePoint'
+ +'(2,2);'#6'8 writeln(''p: '' + inttostr(p.x) + '', '' + inttostr(p.y));'#6
+ +#14' Str1 := ''l'';'#6#14' Str2 := ''o'';'#6#14' Str3 := ''l'';'#6'* if '
+ +'TestString(Str1,Str2,Str3) = ''a'' then'#6'% Writeln(''String test succe'
+ +'sful.'')'#6#6' else'#6'# Writeln(''String test failed.'');'#6'8 if (st'
+ +'r1 = ''l'') and (str2 = ''o'') and (str3 = ''l'') then'#6'( Writeln(''St'
+ +'ring test passed again.'')'#6#6' else'#6'# Writeln(''String test failed'
+ +'.'');'#6#16' Str := ''Test'';'#6''' if TestStringEdit(Str) = ''hopla'' th'
+ +'en'#6', Writeln(''TestStringEdit result passed.'')'#6#6' else'#6'- W'
+ +'riteln(''TestStringEdit result failed.'');'#6#22' if Str = ''tseT'' then'#6
+ +'+ Writeln(''TestStringEdit input passed.'')'#6#6' else'#6', Writeln('
+ +'''TestStringEdit input failed.'');'#6#21' TestArrayEdit(Arr);'#6'" For i '
+ +':= 0 to Length(arr) - 1 do'#6#20' Writeln(Arr[i]);'#6'* Writeln(''it sh'
+ +'ouldve written: "abcd!"'');'#6'1 Arr := TStringArray([''Dit'',''is'',''een'
+ +''',''test'']);'#6#24' TestArrayPassing(arr);'#6'< TestArrayPassing(TStrin'
+ +'gArray([''Dit'',''is'',''een'',''test'']));'#6'& Arr1 := TStringArray([''W'
+ +''',''a'',''t'']);'#6'- Arr2 := TStringArray([''T'',''es'',''t'',''ing'']);'
+ +#6''' Arr3 := TStringArray([''Wowing'',''!'']);'#6'# Arr3 := TestArrayFull'
+ +'(Arr1,Arr2);'#6'/ Writeln(''Should writeln: Hoi Hoe Gaat Het?'');'#6#29' '
+ +'for i := 0 to high(arr1) do'#6#21' Writeln(arr1[i]);'#6#14' Writeln('''
+ +''');'#6'& Writeln(''Should writeln: Testing!'');'#6#29' for i := 0 to hig'
+ +'h(arr2) do'#6#20' writeln(arr2[i]);'#6#14' writeln('''');'#6'3 Writeln('
+ +'''Should writeln: Waza? Gaat alles goed'');'#6#29' for I := 0 to high(arr3'
+ +') do'#6#21' Writeln(arr3[i]);'#6#0#6#4'end.'#0#8'OnChange'#7#11'Memo1Cha'
+ +'nge'#10'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder'#2#0#8'WordWrap'#8#0#0#5'TM'
+ +'emo'#5'Memo2'#4'Left'#2#0#6'Height'#2'l'#3'Top'#3#194#0#5'Width'#3#24#2#5'A'
+ +'lign'#7#8'alBottom'#8'TabOrder'#2#1#0#0#7'TButton'#7'Button1'#4'Left'#2#0#6
+ +'Height'#2'7'#3'Top'#2#0#5'Width'#3#24#2#5'Align'#7#8'alCustom'#7'Anchors'#11
+ +#5'akTop'#6'akLeft'#7'akRight'#0#7'Caption'#6#7'Compile'#7'OnClick'#7#12'But'
+ +'ton1Click'#8'TabOrder'#2#2#0#0#0
]);
diff --git a/Projects/PStest/unit1.pas b/Projects/PStest/unit1.pas
index ead7918..5da2261 100644
--- a/Projects/PStest/unit1.pas
+++ b/Projects/PStest/unit1.pas
@@ -161,16 +161,16 @@ begin
Sender.AddFunction(@testnormal,'function testnormal(num1,num2,num3,num4,num5,num6 : LongInt) : boolean;');
Sender.AddFunctionEx(@teststdcall, 'function teststdcall(num1,num2,num3,num4,num5,num6 : LongInt) : boolean;stdcall;',cdStdCall);
Sender.AddFunctionEx(@testcdecl, 'function testcdecl(num1,num2,num3,num4,num5,num6 : LongInt) : boolean; cdecl;',cdCdecl);
- Sender.AddFunction(@DiffTest,'function DiffTest(num : integer; str : string; byt : byte; wor : longword; bool : boolean) : boolean;');
- Sender.AddFunction(@TestParameters,'procedure TestParameters(Int1,Int2,Int3,Int4,Int5,Int6 : integer);');
- Sender.AddFunction(@TestResult,'function TestResult(Int1,Int2,Int3,Int4,Int5,Int6 : integer): Integer;');
- Sender.AddFunction(@TestString,'function TestString(Str1,Str2,Str3 : string) : string;');
- Sender.AddFunction(@TestStringEdit,'function TestStringEdit(var Str : string) : String;');
- Sender.AddFunction(@TestArrayPassing,'procedure TestArrayPassing(const Arr : TStringArray);');
- Sender.AddFunction(@TestArrayEdit,'Procedure TestArrayEdit(var Arr : TStringArray);');
- Sender.AddFunction(@TestArrayFull,'function TestArrayFull(var Arr1: TStringArray; Arr2 : TStringArray): TStringArray;');
- Sender.AddFunction(@MakeArr,'function MakeArr : TStringArray;');
- Sender.AddFunction(@makePoint, 'function makePoint(x, y: integer): w_Tpoint;');
+ Sender.AddFunctionEx(@DiffTest,'function DiffTest(num : integer; str : string; byt : byte; wor : longword; bool : boolean) : boolean;', cdSafeCall);
+ Sender.AddFunctionEx(@TestParameters,'procedure TestParameters(Int1,Int2,Int3,Int4,Int5,Int6 : integer);', cdSafeCall);
+ Sender.AddFunctionEx(@TestResult,'function TestResult(Int1,Int2,Int3,Int4,Int5,Int6 : integer): Integer;', cdSafeCall);
+ Sender.AddFunctionEx(@TestString,'function TestString(Str1,Str2,Str3 : string) : string;', cdSafeCall);
+ Sender.AddFunctionEx(@TestStringEdit,'function TestStringEdit(var Str : string) : String;', cdSafeCall);
+ Sender.AddFunctionEx(@TestArrayPassing,'procedure TestArrayPassing(const Arr : TStringArray);', cdSafeCall);
+ Sender.AddFunctionEx(@TestArrayEdit,'Procedure TestArrayEdit(var Arr : TStringArray);', cdSafeCall);
+ Sender.AddFunctionEx(@TestArrayFull,'function TestArrayFull(var Arr1: TStringArray; Arr2 : TStringArray): TStringArray;', cdSafeCall);
+ Sender.AddFunctionEx(@MakeArr,'function MakeArr : TStringArray;', cdSafeCall);
+ Sender.AddFunctionEx(@makePoint, 'function makePoint(x, y: integer): w_Tpoint;', cdSafeCall);
end;