Skip to content

Commit eb497f9

Browse files
committed
Перевод: for_next, foreach_next, gosub_return, if_endif, others, repeat_until, select_endselect, while_wend
1 parent 35d2b8f commit eb497f9

File tree

8 files changed

+129
-114
lines changed

8 files changed

+129
-114
lines changed

Russian/Reference/for_next.txt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22

33
@Syntax
44

5-
@Keyword For <variable> = <expression1> @Keyword To <expression2> [@Keyword Step <constant>]
5+
@Keyword For <переменная> = <выражение1> @Keyword To <выражение2> [@Keyword Step(Шаг) <константа>]
66
...
7-
@Keyword Next [<variable>]
7+
@Keyword Next [<переменная>]
88

99
@Description
1010

11-
@Keyword For : @Keyword Next is used to create a loop within a program with the given parameters.
12-
At each loop the <variable> value is increased by a 1, (or of the "Step value" if a @Keyword Step value
13-
is specified) and when the <variable> value is above the <expression2> value, the loop stop.
11+
Оператор @Keyword For : @Keyword Next используется для создания в программе цикла с заданными параметрами.
12+
На каждой итерации значение <переменной> увеличивается на 1, (или на "значение Шага" если задано значение @Keyword Step),
13+
и когда значение <переменной> станет больше значения <выражения2>, цикл прекращается.
1414
@LineBreak
1515
@LineBreak
16-
With the @ReferenceLink "Break_Continue" Break command its possible to exit the @Keyword For : @Keyword Next loop at any moment,
17-
with the @ReferenceLink "Break_Continue" Continue command the end of the current iteration can be skipped.
16+
С помощью команды @ReferenceLink "Break_Continue" Break можно выйти из цикла @Keyword For : @Keyword Next в любой момент,
17+
с помощью команды @ReferenceLink "Break_Continue" Continue можно пропустить остаток текущей итерации.
1818
@LineBreak
1919
@LineBreak
20-
The @Keyword "For : Next" loop works only with integer values, at the expressions as well
21-
at the @Keyword "Step" constant. The @Keyword "Step" constant can also be negative.
20+
Цикл @Keyword "For : Next" работает только с целочисленными значениями, и для выражений, и для константы @Keyword "Step".
21+
Константа @Keyword "Step" также может быть отрицательной.
2222

2323
@Example
2424

@@ -28,7 +28,7 @@
2828
Next
2929
@EndCode
3030

31-
In this example, the program will loop 11, time (0 to 10), then quit.
31+
В этом примере программа повторит цикл 11 раз (от 0 до 10), затем выйдет.
3232

3333
@Example
3434

@@ -38,7 +38,7 @@
3838
Next
3939
@EndCode
4040

41-
In this example, the program will loop 10 times (10 to 1 backwards), then quit.
41+
В этом примере программа повторит цикл 10 раз (от 10 уменьшаясь до 1), затем выйдет.
4242

4343
@Example
4444

@@ -50,9 +50,9 @@
5050
Next k
5151
@EndCode
5252

53-
Here, the program will loop 4 times before quitting, (k is increased by a value of 2 at each loop,
54-
so the k value is: 4-6-8-10). The "k" after the "Next" indicates that "Next" is ending the "For k" loop.
55-
If another variable, is used the compiler will generate an error. It can be useful to nest several "For/Next" loops.
53+
Здесь программа повторит цикл 4 раза прежде чем выйти, (k увеличивается на 2 на каждой итерации,
54+
так что значение k будет: 4-6-8-10). Идентификатор "k" после "Next" показывает, что "Next" заканчивает цикл "For k".
55+
Если использовать другую переменную, компилятор сообщит об ошибке. Это может быть полезно для организации нескольких вложенных циклов "For/Next".
5656

5757
@Example
5858

@@ -64,5 +64,5 @@
6464
Next x
6565
@EndCode
6666

67-
@Bold Note: Be aware, that in PureBasic the value of <expression2> ('To' value) can also be changed inside
68-
the For : Next loop. This can lead to endless loops when wrongly used.
67+
@Bold Примечание: Учтите, что в PureBasic значение <выражения2> (значение 'To') также можно изменить внутри цикла For : Next.
68+
При неправильном использовании это может привести к бесконечным повторам.

Russian/Reference/foreach_next.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88

99
@Description
1010

11-
@Keyword ForEach loops through all elements in the specified list or map starting from the first
12-
element up to the last. If the list or the map is empty, @Keyword ForEach : @Keyword Next exits immediately.
13-
To view all commands used to manage lists, please click @LibraryLink "List" "here".
14-
To view all commands used to manage maps, please click @LibraryLink "Map" "here". @LineBreak
11+
Цикл @Keyword ForEach проходит по всех элементам заданного связанного списка или отображения, начиная
12+
с первого элемента до последнего. Если список или отображение пусто, цикл @Keyword ForEach : @Keyword Next немедленно выходит.
13+
Чтобы увидеть все команды работы со списками, пожалуйста кликните @LibraryLink "List" "здесь".
14+
Чтобы увидеть все команды работы с отображениями, пожалуйста кликните @LibraryLink "Map" "здесь". @LineBreak
1515
@LineBreak
16-
When used with list, it's possible to @Link "List/DeleteElement" "delete" or @Link "List/AddElement" "add" elements
17-
during the loop. As well it's allowed to change the current element with @@ChangeCurrentElement.
18-
After one of the mentioned changes the next loop continues with the element following the current element.
16+
При использовании со связанным списком можно @Link "List/DeleteElement" "удалять" или @Link "List/AddElement" "добавлять" элементы
17+
внутри цикла. Также разрешено передвигать текущий элемент с помощью функции @@ChangeCurrentElement.
18+
После любого из названных изменений цикл продолжится с элемента, следующего за текущим элементом.
1919
@LineBreak
2020
@LineBreak
21-
With the @ReferenceLink "Break_Continue" Break command its possible to exit the @Keyword ForEach : @Keyword Next loop
22-
at any moment, with the @ReferenceLink "Break_Continue" Continue command the end of the current iteration can be skipped.
21+
С помощью команды @ReferenceLink "Break_Continue" Break можно выйти из цикла @Keyword ForEach : @Keyword Next в любой момент,
22+
с помощью команды @ReferenceLink "Break_Continue" Continue можно пропустить остаток текущей итерации.
2323

24-
@Example list
24+
@Example Связанный список (list)
2525

2626
@Code
2727
NewList Number()
@@ -36,18 +36,18 @@
3636
Number() = 30
3737

3838
ForEach Number()
39-
Debug Number() ; Will output 10, 20 and 30
39+
Debug Number() ; Выведет 10, 20 и 30
4040
Next
4141
@EndCode
4242

43-
@Example Map
43+
@Example Отображение (Map)
4444

4545
@Code
4646
NewMap Country.s()
4747

48-
Country("US") = "United States"
49-
Country("FR") = "France"
50-
Country("GE") = "Germany"
48+
Country("UA") = "Украина"
49+
Country("RU") = "Россия"
50+
Country("US") = "США"
5151

5252
ForEach Country()
5353
Debug Country()

Russian/Reference/gosub_return.txt

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@
1111

1212
@Description
1313

14-
@Keyword Gosub stands for 'Go to sub routine'. A @ReferenceLink "general_rules" "label" must be specified after @Keyword Gosub, at that point
15-
the program execution continues immediately after the position defined by that label, and will do so until
16-
encountering a @Keyword Return. When a return is reached, the program execution is then transferred immediately
17-
below the @Keyword Gosub.
14+
Команда @Keyword Gosub буквально означает 'Иди в подпрограмму' и используется для вызова подпрограммы MyLabel.
15+
После @Keyword Gosub должна быть указана @ReferenceLink "general_rules" "метка" подпрограммы,
16+
программа продолжит выполнение с позиции, заданной этой меткой, и будет делать это пока не встретит @Keyword Return.
17+
После выполнения команды @Keyword Return, программа вернется к строке, следующей за командой @Keyword Gosub.
1818
@LineBreak
19-
@Keyword Gosub is useful when building fast structured code.
19+
Команда @Keyword Gosub полезна для создания быстрого структурированного кода.
2020
@LineBreak
2121
@LineBreak
22-
Another technique which may be used in order to insert a sub routine into a standalone program component
23-
is to use @ReferenceLink "procedures" "procedures".
24-
@Keyword Gosub may only be used within the main body of the source code, and may not be used within
25-
@ReferenceLink "procedures" "procedures".
22+
Другой приём, с помощью которого можно вставить подпрограмму в самостоятельный компонент программы,
23+
это @ReferenceLink "procedures" "процедуры".
24+
@Keyword Gosub можно использовать только внутри основного кода, но нельзя использовать внутри
25+
@ReferenceLink "procedures" "процедур".
2626

2727
@Example
2828

@@ -45,9 +45,12 @@
4545

4646
@Description
4747

48-
If the command @ReferenceLink "Others" Goto is used within the body of a sub routine, @Keyword FakeReturn must be used.
49-
@Keyword FakeReturn simulates a return without actually executing a return, and if it is not used, the program will crash.
50-
Note: To exit a loop safely, @ReferenceLink "break_continue" "Break" should be used instead of Goto.
48+
Если Вы хотите совершить прыжок (@ReferenceLink "Others" Goto) из подпрограммы в другую часть кода (вне подпрограммы)
49+
- следует использовать @Keyword FakeReturn для имитации выхода из подпрограммы.
50+
@Keyword FakeReturn имитирует @Keyword Return без выполнения возврата, и если его не использовать, программа даст сбой. @LineBreak
51+
Примечание 1: Чтобы безопасно завершить цикл, вместо @ReferenceLink "Others" Goto следует использовать @ReferenceLink "break_continue" "Break". @LineBreak
52+
Примечание 2: Не рекомендуется использовать эту команду, потому что хорошо созданная программа не использует @ReferenceLink "Others" Goto.
53+
Но иногда, по причине быстродействия, это может помочь программисту.
5154

5255
@Example
5356

Russian/Reference/if_endif.txt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22

33
@Syntax
44

5-
@Keyword If <expression>
5+
@Keyword If <переменная>
66
...
7-
[@Keyword ElseIf <expression>]
7+
[@Keyword ElseIf <переменная>]
88
...
99
[@Keyword Else]
1010
...
1111
@Keyword EndIf
1212

1313
@Description
1414

15-
The @Keyword If structure is used to achieve tests, and/or change the programmes direction, depending on whether the test is true or false.
16-
@Keyword ElseIf optional command is used for any number of additional tests if the previous test was not true.
17-
The @Keyword Else optional command is used to execute a part of code, if all previous tests were false.
18-
Any number of @Keyword If structures may be nested together. @LineBreak
15+
Структура @Keyword If используется для проверок, и/или изменения хода выполнения программы, в зависимости от истинности или ложности результата проверки.
16+
Необязательная команда @Keyword ElseIf используется для любого количества добавочных проверок, если предыдущая проверка не была истинной.
17+
Необязательная команда @Keyword Else используется для выполнения части кода в том случае, если все предыдущие проверки были ложными.
18+
Можно вложить друг в друга любое количество структур @Keyword If. @LineBreak
1919
@LineBreak
20-
Short-circuit evaluations for expressions are supported, meaning if a test is true, all following tests will be ignored and not even run.
20+
Проверки "Короткого замыкания" для выражений поддерживаются, это означает, если проверка выполнена, то все следующие тесты будут игнорироваться, и даже не выполняться.
2121

22-
@Example Basic test
22+
@Example Простая проверка
2323

2424
@Code
2525
a = 5
@@ -30,33 +30,33 @@
3030
EndIf
3131
@EndCode
3232

33-
@Example Multiple test
33+
@Example Несколько проверок
3434

3535
@Code
3636
b = 15
3737
If a = 10 And b >= 10 Or c = 20
3838
If b = 15
3939
Debug "b = 15"
4040
Else
41-
Debug "Other possibility"
41+
Debug "Другая возможность"
4242
EndIf
4343
Else
44-
Debug "Test failure"
44+
Debug "Проверка не пройдена"
4545
EndIf
4646
@EndCode
4747

48-
@Example Short-circuit test
48+
@Example Проверка "Короткое замыкание"
4949

5050
@Code
5151
Procedure DisplayHello()
52-
Debug "Hello"
52+
Debug "Привет"
5353
ProcedureReturn 1
5454
EndProcedure
5555

5656
a = 10
57-
If a = 10 Or DisplayHello() = 1 ; a is equal to 10, so the second test is fully ignored
58-
Debug "Test success"
57+
If a = 10 Or DisplayHello() = 1 ; значение "а" равно 10, так что второй тест полностью игнорируется
58+
Debug "Проверка пройдена"
5959
Else
60-
Debug "Test failure"
60+
Debug "Проверка не пройдена"
6161
EndIf
6262
@EndCode

Russian/Reference/others.txt

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
@Title Others Commands
1+
@Title Другие команды
22

33
@Syntax
44

5-
@Keyword Goto <label>
5+
@Keyword Goto <метка>
66

77
@Description
88

9-
This command is used to transfer the program directly to the labels position. Be cautious when using
10-
this function, as incorrect use could cause a program to crash... @LineBreak
9+
Эта команда используется для перевода программы прямо к позиции <метка>. Будьте осторожны
10+
при использовании этой функции, так как некорректное использование может вызвать сбой программы... @LineBreak
1111
@LineBreak
12-
Note: To exit a loop safely, you always should use @ReferenceLink "Break_Continue" Break instead of @Keyword Goto.
12+
Примечание: Чтобы безопасно выйти из цикла, вам всегда следует использовать @ReferenceLink "Break_Continue" Break вместо @Keyword Goto.
1313

1414
; ---------------------------------------------------------------------------------------------------
1515

@@ -19,48 +19,59 @@
1919

2020
@Description
2121

22-
Ends the program execution correctly. The 'ExitCode' optional parameter can be specified if the
23-
program need to returns an error code (widely used in console programs).
22+
Корректно заканчивает выполнение программы. Можно задать необязательный параметр 'ExitCode', если программа
23+
должна возвратить код ошибки (широко используется в консольных программах).
2424
@LineBreak
2525
@LineBreak
26-
The 'ExitCode' can be further used e.g. with the @@ProgramExitCode command.
26+
'ExitCode' может в дальнейшем использоваться например с командой @@ProgramExitCode.
27+
28+
@Example
29+
@Code
30+
Program = RunProgram("Vasha_programma.exe", "Параметр", "C:\rabochaya_papka_vashei_programmi\", #PB_Program_Wait)
31+
; Прога Vasha_programma.exe запущена с параметром Параметр и с рабочей папкой C:\rabochaya_papka_vashei_programmi\,
32+
; программа, запустившая её, ожидает завершения проги Vasha_programma.exe
33+
34+
Result = ProgramExitCode(Program); по завершении программы Vasha_programma.exe запустившая её программа получит exitcode
35+
@EndCode
2736

2837
; ---------------------------------------------------------------------------------------------------
2938

3039
@Syntax
3140

32-
@Keyword Swap <expression>, <expression>
41+
@Keyword Swap <выражение>, <выражение>
3342

3443
@Description
3544

36-
Swaps the value of the both expression, in an optimized way. The both <expression> have to be
37-
a @ReferenceLink "variables" "variable", @ReferenceLink "dim" "array", @ReferenceLink "newlist" "list" or a @ReferenceLink "newmap" "map"
38-
element (structured or not) and have to be one of the
39-
PureBasic native type like long (.l), quad (.q), string etc.
45+
Изменяет значения обоих выражений оптимизированным способом, меняя их местами. Оба <выражения> должны
46+
быть @ReferenceLink "variables" "переменными", @ReferenceLink "dim" "массивами", @ReferenceLink "newlist" "связанными списками" или
47+
элементы @ReferenceLink "newmap" "отображения" (структурированного или нет) и принадлежать одному из
48+
@ReferenceLink "variables" "типов" PureBasic, такому как long (.l), quad (.q), string и т.д.
4049

41-
@Example Swapping of strings
50+
@Example Обмен строк
4251
@Code
43-
Hello$ = "Hello"
44-
World$ = "World"
52+
Hello$ = "Привет"
53+
World$ = "Мир"
54+
55+
Debug Hello$+" "+World$ ; выведет "Привет Мир"
4556

4657
Swap Hello$, World$
4758

48-
Debug Hello$+" "+World$
59+
Debug Hello$+" "+World$ ; выведет "Мир Привет"
4960
@EndCode
5061

51-
@Example Swapping of multi-dimensional arrays elements
62+
@Example Обмен многомерных массивов
5263
@Code
5364
Dim Array1(5,5)
5465
Dim Array2(5,5)
55-
Array1(2,2) = 10 ; set initial contents
66+
Array1(2,2) = 10 ; задаём начальное содержание
5667
Array2(3,3) = 20
5768

58-
Debug Array1(2,2) ; will print 10
59-
Debug Array2(3,3) ; will print 20
69+
Debug Array1(2,2) ; выведет 10
70+
Debug Array2(3,3) ; выведет 20
6071

61-
Swap Array1(2,2) , Array2(3,3) ; swap 2 arrays elements
72+
Swap Array1(2,2) , Array2(3,3) ; обмениваем 2 элемента массивов
6273

63-
Debug "Array contents after swapping:"
64-
Debug Array1(2,2) ; will print 20
65-
Debug Array2(3,3) ; will print 10
74+
Debug "Содержание массивов после обмена:"
75+
Debug Array1(2,2) ; выведет 20
76+
Debug Array2(3,3) ; выведет 10
6677
@EndCode

0 commit comments

Comments
 (0)