Skip to content

Commit 1119af5

Browse files
author
DEntisT
committed
syntax file updates
1 parent 9dff0f9 commit 1119af5

12 files changed

Lines changed: 55 additions & 22 deletions

File tree

doc/return.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
- In PawnScript, to return a value it means to execute the code and give the result output, after returning a value, code block execution will stop.
88

99
```cpp
10-
int MyForm() public;
10+
int MyForm() public
1111
{
12-
console.println("Hello World");
13-
return,1;
14-
console.println("This code won't be executed");
12+
console.println("Hello World")
13+
return 1
14+
console.println("This code won't be executed")
1515
}
1616

17-
console.cout(MyForm);
18-
system.rem("Thing above will print 1");
17+
console.cout(MyForm)
18+
system.rem("Thing above will print 1")
1919
```
2020

2121

@@ -24,15 +24,15 @@ system.rem("Thing above will print 1");
2424
- `yield` return will do the same thing as a normal return, the difference is that the code block won't stop being executed until `};` or `return..,..;`.
2525

2626
```cpp
27-
int MyForm() public;
27+
int MyForm() public
2828
{
29-
console.println("Hello World");
30-
yield&return,1;
31-
console.println("This code will be executed too");
29+
console.println("Hello World")
30+
yield&return,1
31+
console.println("This code will be executed too")
3232
}
3333

3434
console.cout(MyForm);
35-
system.rem("Thing above will print 1");
35+
system.rem("Thing above will print 1")
3636
```
3737

3838

@@ -43,16 +43,16 @@ system.rem("Thing above will print 1");
4343
Little example:
4444

4545
```cpp
46-
int TestFunction() public;
46+
int TestFunction() public
4747
{
48-
return.bool,false;
48+
return bool false
4949
}
5050
```
5151

5252
- Return type assigned to a function `TestFunction` is integer, but we returned a boolean. If we do not want to return any value, we just assign the `void` return type:
5353

5454
```cpp
55-
void TestFunction() public;
55+
void TestFunction() public
5656
{
57-
system.rem("Now we can't use a return keyword in this function block.");
57+
system.rem("Now we can't use a return keyword in this function block.")
5858
}

scriptfiles/index.ps

279 Bytes
Binary file not shown.

scriptfiles/modules/args.ps

1 Byte
Binary file not shown.

scriptfiles/modules/data.ps

0 Bytes
Binary file not shown.

scriptfiles/modules/emit.ps

1 Byte
Binary file not shown.

scriptfiles/modules/enum.ps

-1 Bytes
Binary file not shown.

scriptfiles/modules/inline.ps

1 Byte
Binary file not shown.

scriptfiles/modules/iter.ps

-9 Bytes
Binary file not shown.

scriptfiles/modules/math.ps

-1 Bytes
Binary file not shown.

src/modules/header.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ DO NOT CHANGE THEM!
5353
#define @PAWNSCRIPT_INTERNAL__@Float:return>%1(%2) dpp_vardata[dpp_retvar__][floatvalue]=%2;return 1
5454
#define @PAWNSCRIPT_INTERNAL__@bool:return>%1(%2) dpp_vardata[dpp_retvar__][boolvalue]=%2;return 1
5555
#define @PAWNSCRIPT_INTERNAL__@string:return>%1(%2<%3>) strmid(dpp_vardata[dpp_retvar__][stringvalue],%2,0,%3,%3);return 1
56-
#define @PAWNSCRIPT_INTERNAL__@char%0return>%1(%2<%3>) dpp_vardata[dpp_retvar__][charvalue]=%2;return 1
56+
#define @PAWNSCRIPT_INTERNAL__@char%0return>%1(%2) dpp_vardata[dpp_retvar__][charvalue]=%2;return 1
5757

5858
#define @PAWNSCRIPT_INTERNAL__@pri> dpp_pri__
5959
#define @PAWNSCRIPT_INTERNAL__@alt> dpp_alt__

0 commit comments

Comments
 (0)