mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-30 01:39:28 +02:00
pastojs: for s in arrayofstring
git-svn-id: trunk@38702 -
This commit is contained in:
parent
b64b45e26c
commit
1237e11765
@ -349,6 +349,7 @@ type
|
|||||||
Procedure TestArray_Copy;
|
Procedure TestArray_Copy;
|
||||||
Procedure TestArray_InsertDelete;
|
Procedure TestArray_InsertDelete;
|
||||||
Procedure TestArray_DynArrayConst;
|
Procedure TestArray_DynArrayConst;
|
||||||
|
Procedure TestArray_ForInArrOfString;
|
||||||
Procedure TestExternalClass_TypeCastArrayToExternalArray;
|
Procedure TestExternalClass_TypeCastArrayToExternalArray;
|
||||||
Procedure TestExternalClass_TypeCastArrayFromExternalArray;
|
Procedure TestExternalClass_TypeCastArrayFromExternalArray;
|
||||||
|
|
||||||
@ -7072,6 +7073,42 @@ begin
|
|||||||
'']));
|
'']));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TTestModule.TestArray_ForInArrOfString;
|
||||||
|
begin
|
||||||
|
StartProgram(false);
|
||||||
|
Add([
|
||||||
|
'type',
|
||||||
|
'type',
|
||||||
|
' TMonthNameArray = array [1..12] of string;',
|
||||||
|
' TMonthNames = TMonthNameArray;',
|
||||||
|
' TObject = class',
|
||||||
|
' private',
|
||||||
|
' function GetLongMonthNames: TMonthNames; virtual; abstract;',
|
||||||
|
' public',
|
||||||
|
' Property LongMonthNames : TMonthNames Read GetLongMonthNames;',
|
||||||
|
' end;',
|
||||||
|
'var f: TObject;',
|
||||||
|
' Month: string;',
|
||||||
|
'begin',
|
||||||
|
' for Month in f.LongMonthNames do ;',
|
||||||
|
'']);
|
||||||
|
ConvertProgram;
|
||||||
|
CheckSource('TestArray_ForInArrOfString',
|
||||||
|
LinesToStr([ // statements
|
||||||
|
'rtl.createClass($mod, "TObject", null, function () {',
|
||||||
|
' this.$init = function () {',
|
||||||
|
' };',
|
||||||
|
' this.$final = function () {',
|
||||||
|
' };',
|
||||||
|
'});',
|
||||||
|
'this.f = null;',
|
||||||
|
'this.Month = "";',
|
||||||
|
'']),
|
||||||
|
LinesToStr([ // $mod.$main
|
||||||
|
'for (var $in1 = $mod.f.GetLongMonthNames(), $l2 = 0, $end3 = rtl.length($in1) - 1; $l2 <= $end3; $l2++) $mod.Month = $in1[$l2];',
|
||||||
|
'']));
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TTestModule.TestExternalClass_TypeCastArrayToExternalArray;
|
procedure TTestModule.TestExternalClass_TypeCastArrayToExternalArray;
|
||||||
begin
|
begin
|
||||||
StartProgram(false);
|
StartProgram(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user