exec
This function executes the statements either formulated as direct code or provided in a string.
Indirect parameter passing is disabled
1
No. | Type | Description |
---|---|---|
1 code |
statements :string |
statement to execute |
st[] = "for (a[] = 1, a[] <= 3, a[]++) echo(a[]);";
exec( for (a[] = 1, a[] <= 3, a[]++) echo(a[]) ) ;
exec( :st[] );
// Note the required colon. Otherwise st[] is seen as an incomplete statement.
1
2
3
1
2
3