Skip to content

Commit d6b47b8

Browse files
committed
0.3.1
1 parent a9bea71 commit d6b47b8

File tree

153 files changed

+39568
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+39568
-2
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/.*
22
/ax3
3-
/ax4
43
/ax2012
54
!.gitignore

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ see also [Releases on GitHub](https://github.com/mazzy-ax/SysEnumerators/release
44

55
## 0.3.1 - 2018-04-24
66

7+
* Добавлен проект с энумераторами для ax4
78
* Добавлен `SysEnumerator_Sleep`
89
* Явно определен метод moveNext в интерфейсе `ISysEnumerator`. Раньше метод только наследовался
910
* энумераторы `SysEnumerator_Counter` теперь считают от 1, а не от 0
1011
* энумераторы `SysEnumerator_Indexed` теперь по умолчанию энумерируют все целые. Раньше по умолчанию устанавливался пустой диапазон
11-
* Добавлен проект для ax4
1212

1313
## 0.3.0 - 2018-04-23
1414

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// mazzy, https://github.com/mazzy-ax/SysEnumerators
3+
//
4+
static void SysEnumeratorExample01_Int(Args _args)
5+
{
6+
SysEnumerator se = SysEnumerator::newFromToInt(2, 9, 3);
7+
8+
while( se.moveNext() )
9+
{
10+
info(strfmt("%1", se.current()));
11+
}
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// mazzy, https://github.com/mazzy-ax/SysEnumerators
3+
//
4+
static void SysEnumeratorExample02_Date(Args _args)
5+
{
6+
SysEnumerator se = SysEnumerator::newFromToDate(01\04\2018, 30\04\2018, 5);
7+
8+
while( se.moveNext() )
9+
{
10+
info(strfmt("%1, %2", se.current(), dayofwk(se.current())));
11+
}
12+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// mazzy, https://github.com/mazzy-ax/SysEnumerators
3+
//
4+
static void SysEnumeratorExample03_Container(Args _args)
5+
{
6+
container c = ['a', 'b', 1, 'd', systemdateget(), 'f'];
7+
SysEnumerator se = SysEnumerator::newFromContainer(c);
8+
9+
while( se.moveNext() )
10+
{
11+
info(strfmt("%1", se.current()));
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// mazzy, https://github.com/mazzy-ax/SysEnumerators
3+
//
4+
static void SysEnumeratorExample04_Enum(Args _args)
5+
{
6+
LedgerTransType transType;
7+
SysEnumerator se = SysEnumerator::newFromEnum(transType);
8+
9+
while( se.moveNext() )
10+
{
11+
info(strfmt("%1 %2 %3 %4", se.current(), se.currentIdx(), se.currentKey(), se.currentValue()));
12+
}
13+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//
2+
// mazzy, https://github.com/mazzy-ax/SysEnumerators
3+
//
4+
static void SysEnumeratorExample05_Fields(Args _args)
5+
{
6+
CustTable custTable;
7+
SysEnumerator_DictTable_Field se = SysEnumerator_DictTable_Field::construct(new DictTable(custTable.TableId));
8+
9+
while( se.moveNext() )
10+
{
11+
info(strfmt("%1, %2, %3", se.current(), se.currentKey(), se.currentValue().toString()));
12+
}
13+
14+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// mazzy, https://github.com/mazzy-ax/SysEnumerators
3+
//
4+
static void SysEnumeratorExample06_File(Args _args)
5+
{
6+
#WinAPI
7+
8+
FileName myDocumentsFolder = WinAPI::getFolderPath(#CSIDL_Personal);
9+
Filename fileName = myDocumentsFolder + @'\test.csv';
10+
CommaIo commaIo = new CommaIo(fileName, 'R');
11+
SysEnumerator_CommaIo se = SysEnumerator_CommaIo::construct(commaIo);
12+
13+
while( se.moveNext() )
14+
{
15+
info(Con2Str(se.current()));
16+
}
17+
18+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// mazzy, https://github.com/mazzy-ax/SysEnumerators
3+
//
4+
static void SysEnumeratorExample07_Group(Args _args)
5+
{
6+
SysEnumerator_SysOperationProgress progress = SysEnumerator_SysOperationProgress::construct();
7+
SysEnumerator_FillSetFromValue values2set = SysEnumerator_FillSetFromValue::construct();
8+
9+
SysEnumerator se = SysEnumerator::construct()
10+
.add(progress)
11+
.add(values2set)
12+
.add(SysEnumerator_First::construct(1000));
13+
14+
while( se.moveNext() )
15+
{
16+
// my super business logic
17+
18+
progress.base().setText(strfmt("%1, %2", se.current(), values2set.base().elements()));
19+
}
20+
21+
info(values2set.base().toString());
22+
23+
}

ax4/Examples/README.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Примеры использования SysEnumerators
2+
3+
## 1. [Пробежать по интервалу чисел от 2 до 9 с шагом 3](Job_SysEnumeratorExample01_Int.xpp)
4+
5+
![SysEnumeratorExample01_Int](../Media/Example01.png)
6+
7+
```java
8+
SysEnumerator se = SysEnumerator::newFromToInt(2, 9, 3);
9+
10+
while( se.moveNext() )
11+
{
12+
info(strfmt("%1", se.current()));
13+
}
14+
```
15+
16+
## 2. [Пробежать по интервалу дат с шагом 5 дней](Job_SysEnumeratorExample02_Date.xpp)
17+
18+
![SysEnumeratorExample02_Date](../Media/Example02.png)
19+
20+
```java
21+
SysEnumerator se = SysEnumerator::newFromToDate(01\04\2018, 30\04\2018, 5);
22+
23+
while( se.moveNext() )
24+
{
25+
info(strfmt("%1, %2", se.current(), dayofwk(se.current())));
26+
}
27+
```
28+
29+
## 3. [Пробежать по элементам контейнера](Job_SysEnumeratorExample03_Container.xpp)
30+
31+
![SysEnumeratorExample03_Container](../Media/Example03.png)
32+
33+
```java
34+
container c = ['a', 'b', 1, 'd', systemdateget(), 'f'];
35+
SysEnumerator se = SysEnumerator::newFromContainer(c);
36+
37+
while( se.moveNext() )
38+
{
39+
info(strfmt("%1", se.current()));
40+
}
41+
```
42+
43+
## 4. [Пробежать по перечислению enum](Job_SysEnumeratorExample04_Enum.xpp)
44+
45+
![SysEnumeratorExample04_Enum](../Media/Example04.png)
46+
47+
```java
48+
LedgerTransType transType;
49+
SysEnumerator se = SysEnumerator::newFromEnum(transType);
50+
51+
while( se.moveNext() )
52+
{
53+
info(strfmt("%1 %2 %3 %4", se.current(), se.currentIdx(), se.currentKey(), se.currentValue()));
54+
}
55+
```
56+
57+
## 5. [Пробежать по полям таблицы](Job_SysEnumeratorExample05_Fields.xpp)
58+
59+
![SysEnumeratorExample05_Fields](../Media/Example05.png)
60+
61+
```java
62+
LedgerTransType transType;
63+
SysEnumerator se = SysEnumerator::newFromEnum(transType);
64+
65+
while( se.moveNext() )
66+
{
67+
info(strfmt("%1 %2 %3 %4", se.current(), se.currentIdx(), se.currentKey(), se.currentValue()));
68+
}
69+
```
70+
71+
## 6. [Пробежать по CSV-файлу](Job_SysEnumeratorExample06_File.xpp)
72+
73+
![SysEnumeratorExample06_File](../Media/Example06.png)
74+
75+
```java
76+
FileName myDocumentsFolder = WinAPI::getFolderPath(#CSIDL_Personal);
77+
Filename fileName = myDocumentsFolder + @'\test.csv';
78+
CommaIo commaIo = new CommaIo(fileName, 'R');
79+
SysEnumerator_CommaIo se = SysEnumerator_CommaIo::construct(commaIo);
80+
81+
while( se.moveNext() )
82+
{
83+
info(Con2Str(se.current()));
84+
}
85+
```
86+
87+
## 7. [Работа с группой энумераторов](Job_SysEnumeratorExample06_File.xpp)
88+
89+
![SysEnumeratorExample07_Group](../Media/Example07.png)
90+
91+
```java
92+
SysEnumerator_SysOperationProgress progress = SysEnumerator_SysOperationProgress::construct();
93+
SysEnumerator_FillSetFromValue values2set = SysEnumerator_FillSetFromValue::construct();
94+
95+
SysEnumerator se = SysEnumerator::construct()
96+
.add(progress)
97+
.add(values2set)
98+
.add(SysEnumerator_First::construct(1000));
99+
100+
while( se.moveNext() )
101+
{
102+
// my super business logic
103+
104+
progress.base().setText(strfmt("%1, %2", se.current(), values2set.base().elements()));
105+
}
106+
107+
info(values2set.base().toString());
108+
```

0 commit comments

Comments
 (0)