MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 1 | SYNOPSIS |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 2 | mixed * to_array(string) |
| 3 | mixed * to_array(bytes) |
| 4 | mixed * to_array(symbol) |
| 5 | mixed * to_array(quotedarray) |
| 6 | mixed * to_array(mixed *) |
| 7 | mixed * to_array(struct) |
| 8 | mixed * to_array(lpctype) |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 9 | |
| 10 | (int*)<value> |
| 11 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 12 | DESCRIPTION |
| 13 | Strings and symbols are converted to an int array that |
| 14 | consists of the args characters. Note that the string "12" will be |
| 15 | converted to the array ({ 33, 34 }), and not ({ 33, 34, 0 }) (the |
| 16 | LDMud versions prior to 3.3 returned the latter array). |
Zesstra | 8778584 | 2019-11-27 19:59:07 +0100 | [diff] [blame] | 17 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 18 | Byte sequences are converted into an array of these bytes. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 19 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 20 | Quoted arrays are ``dequoted'', and arrays are left as they |
| 21 | are. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 22 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 23 | Structs are converted into a normal array. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 24 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 25 | Union lpc types are split into their union member types |
| 26 | (in no particular order). |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 27 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 28 | BUGS |
| 29 | The cast notation only works if the precise type of <value> |
| 30 | is known at compile-time. This will not be fixed - use the |
| 31 | function form instead. |
| 32 | |
| 33 | HISTORY |
| 34 | LDMud 3.3.250 added structs to the accepted data types. |
| 35 | |
| 36 | SEE ALSO |
| 37 | to_int(E), to_string(E), to_struct(E) |