With a minor modification to line 25, the leading space will be dropped for 
only positive numbers and zero.

 

10 INPUT A%

20 PRINT"*"STR$(A%)"*"

25 PRINT"*"RIGHT$(STR$(A%),LEN(STR$(A%))-.5*(SGN(A%)+1))"*"

30 GOTO 10

 

Very messy…

 

 

 

 

From: M100 <m100-boun...@lists.bitchin100.com> On Behalf Of 
lloydel...@comcast.net
Sent: Sunday, July 9, 2023 6:39 PM
To: m...@bitchin100.com
Subject: Re: [M100] Convert integer to string WITHOUT leading space?

 

Line 25 loses the minus sign for negative numbers.   Just be positive on 
everything then it isn’t a problem.  😊

 

From: M100 <m100-boun...@lists.bitchin100.com 
<mailto:m100-boun...@lists.bitchin100.com> > On Behalf Of 
lloydel...@comcast.net <mailto:lloydel...@comcast.net> 
Sent: Sunday, July 9, 2023 6:37 PM
To: m...@bitchin100.com <mailto:m...@bitchin100.com> 
Subject: Re: [M100] Convert integer to string WITHOUT leading space?

 

 

Line 20 has the leading space and line 25 doesn’t.   It’s  brute force but it 
is one way to get rid of the leading space.

Lloyd

 



 

-----Original Message-----
From: M100 <m100-boun...@lists.bitchin100.com 
<mailto:m100-boun...@lists.bitchin100.com> > On Behalf Of mark audacity romberg
Sent: Sunday, July 9, 2023 5:58 PM
To: m100@lists.bitchin100.com <mailto:m100@lists.bitchin100.com> 
Subject: [M100] Convert integer to string WITHOUT leading space?

 

How do I do this? STR$(A%) returns the value of A% with a leading space. This 
is not how the M100 manual indicates STR$() works, and I can’t believe there’s 
no way to get a numerical variable as a string that’s just the number?

 

 

Reply via email to