Mikroelektronika MIKROE-442 데이터 시트
670
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
StrToInt
Prototype
sub function StrToInt(dim byref input as string[6]) as integer
Description Converts a string to an integer.
Parameters -
Parameters -
input
: string to be converted
Returns
Integer variable.
Requires
Input string is assumed to be the correct representation of a number. The conversion will end with the
first character which is not a decimal digit.
Example
dim ii as integer
main:
...
ii = StrToInt(“-1234”)
end.
Notes
None.
StrToWord
Prototype
sub function StrToWord(dim byref input as string[5]) as word
Description Converts a string to word.
Parameters -
Parameters -
input
: string to be converted
Returns
Word variable.
Requires
Input string is assumed to be the correct representation of a number. The conversion will end with the
first character which is not a decimal digit.
Example
dim ww as word
main:
...
ww = StrToword(“65432”)
end.
Notes
None.
Bcd2Dec
Prototype
sub function Bcd2Dec(dim bcdnum as byte) as byte
Description Converts input BCD number to its appropriate decimal representation.
Parameters -
Parameters -
bcdnum
: number to be converted
Returns
Converted decimal value.
Requires
Nothing.
Example
dim a, b as byte
...
a = 22
b = Bcd2Dec(a) ‘ b equals 34
Notes
None.