Creates a new instance of the function.
()
| 150 | impl AscFunction { |
| 151 | /// Creates a new instance of the function. |
| 152 | pub fn new() -> Rc<Self> { |
| 153 | Rc::from(Self { |
| 154 | metadata: CallableMetadataBuilder::new("ASC") |
| 155 | .with_return_type(ExprType::Integer) |
| 156 | .with_syntax(&[( |
| 157 | &[SingularArgSyntax::RequiredValue( |
| 158 | RequiredValueSyntax { name: Cow::Borrowed("char"), vtype: ExprType::Text }, |
| 159 | ArgSepSyntax::End, |
| 160 | )], |
| 161 | None, |
| 162 | )]) |
| 163 | .with_category(CATEGORY) |
| 164 | .with_description( |
| 165 | "Returns the UTF character code of the input character. |
| 166 | The input char$ argument is a string that must be 1-character long. |
| 167 | This is called ASC for historical reasons but supports more than just ASCII characters in this \ |
| 168 | implementation of BASIC. |
| 169 | See CHR$() for the inverse of this function.", |
| 170 | ) |
| 171 | .build(), |
| 172 | }) |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | impl Callable for AscFunction { |
nothing calls this directly
no test coverage detected