Function String2OrderIdBJ
| 3321 | function String2OrderIdBJ takes string orderIdString returns integer |
| 3322 | local integer orderId |
| 3323 | |
| 3324 | // Check to see if it's a generic order.
|
| 3325 | set orderId = OrderId(orderIdString) |
| 3326 | if (orderId != 0) then |
| 3327 | return orderId
|
| 3328 | endif
|
| 3329 | |
| 3330 | // Check to see if it's a (train) unit order.
|
| 3331 | set orderId = UnitId(orderIdString) |
| 3332 | if (orderId != 0) then |
| 3333 | return orderId
|
| 3334 | endif
|
| 3335 | |
| 3336 | // Unrecognized - return 0
|
| 3337 | return 0 |
| 3338 | endfunction
|