User manual

664
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
LongWordToStr
Prototype
sub procedure LongWordToStr(dim input as longword, dim byref output as
string[10])
Description Converts input double word number to a string. The output string is right justied and the remaining
positions on the left (if any) are lled with blanks.
Parameters - input: double word number to be converted
- output: destination string
Returns Nothing.
Requires Nothing.
Example
dim input as longint
txt as string[10]
...
input = 12345678
IntToStr(input, txt) ‘ txt is “ 12345678”
Notes None.
FloatToStr
Prototype
sub procedure FloatToStr(dim fnum as oat, dim byref str as string[20]) as
byte
Description Converts a oating point number to a string.
The output string is left justied and null terminated after the last digit.
Parameters - fnum: oating point number to be converted
- str: destination string
Returns Nothing.
Requires Nothing.
Example
dim ff1, ff2, ff3 as oat
txt as string[20]
...
ff1 = -374.2
ff2 = 123.456789
ff3 = 0.000001234
FloatToStr(ff1, txt) ‘ txt is “-374.2”
FloatToStr(ff2, txt) ‘ txt is “123.4567”
FloatToStr(ff3, txt) ‘ txt is “1.234e-6”
Notes Given oating point number will be truncated to 7 most signicant digits before conversion.