Mikroelektronika MIKROE-724 データシート

ページ / 726
662
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
WordToStr
Prototype
sub procedure WordToStr(dim input as word, dim byref output as string[5])
Description Converts input word to a string. The output string is right justified and the remaining positions on the 
left (if any) are filled with blanks.
Parameters -
 input:
 word to be converted 
output:
 destination string 
Returns
Nothing.
Requires
Nothing.
Example
dim t as word
    txt as string[5]
...
t = 437
WordToStr(t, txt)  ‘ txt is “  437” (two blanks here)
Notes
None.
WordToStrWithZeros
Prototype
sub  procedure  WordToStrWithZeros(dim  input  as  word,  dim  byref  output  as 
string[5])
Description Converts input word to a string. The output string is right justified and the remaining positions on the 
left (if any) are filled with zeros.
Parameters 
input: 
signed integer number to be converted 
output: 
destination string 
Returns
Nothing.
Requires
Nothing.
Example
dim t as word
    txt as string[5]
...
t = 437
WordToStrWithZeros(t, txt)  ‘ txt is ‘00437’
Notes
None.