The Str$ function is good for doing this, but it leaves a leading space. You need to nest the Str$ inside the Ltrim$ function. Your resulting code will look like:
No$ = LTrim$(Str$(No%))
There is also a RTrim$ function for removing trailing spaces, but it is not needed for this example.
Nyaj2k1 supposed you wanted to have an user readable number, his solution does that.
However if you want to store the number as a string you can use
no$=mki$(no%)
It makes a string of the same size of the integer variable
and simply copies the bits of the variable into it.
There are different functions depending of the tipe of the variable mkl$ for longs, mkS$ for single, mkd$ for doubles Antoni
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.