h6. [[OS SWI Calls]] h6(. » OS_SWINumberFromString h2. OS_SWINumberFromString h5. (SWI &39) |_<^{width:4em}. Entry | | |<^. R1 |<^. Pointer to name (control terminated) | |_<^{width:4em}. Exit | | |<^. R0 |<^. SWI number | |<^. R1 |<^. Preserved | h4. Use The purpose of this call is to convert a SWI name string to a SWI number. h4. Notes An error is given if the SWI name is not recognized. The conversion is as follows: * A leading X is stripped. If present, it will cause &20000 to be added to the number returned (bit 17) * System names are checked for. Note that the conversion of SWIs isn't very bidirectional: the name OS_WriteI+" " can be produced, but only [[OS_WriteI]] is recognised * Modules are scanned. If the module prefix matches the one given, and the suffix to the name is a number, then that number is added to the module's SWI 'chunk' base, and the sum returned. For example, Wimp_&23 returns &400E3, as the Wimp's chunk number is &400C0 * If the suffix is a name, and this can be matched by the module, the appropriate number is returned. For example, [[Wimp_Poll]] returns &400C7 h4. See also * [[OS_SWINumberToString]]