In my app, I have have a timer. I would like it have the format "xx:yy" where x are the minutes and y are the seconds. I have tried many things, but have been unable to get anything to work. I know there are probably ways to do this this within a lot of string variable constructs, but preferring a simpler way, is it possible to use a TEXT command that uses the "USING" comand?
Kevin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Although this has been gnawing at me for some time, it was not a show stopper, and I had many more problems to fix. And although I have been through the manual over and over many times, my mind is not capable of even understanding most of it, nor large enough to categorize and memorize it. However, yesterday I came across the USING$ command, and it was assigned to a string$ constant. I was familiar with the PRINT USING command from the '70s, but this was the 1st time I had come upon the USING$ command that actually registered as a posible candidate to rectify my situation.
So I tried this: text 425,105,USING$(mins%,"00")+":"+USING$(secs%,"00")
and it worked.
I had prviously tried: text 425,105,STR$(mins%,2)+":"+STR$(secs%,2) and several other things,
but always, the leading zeros disappeared.
The nice thing I like about the USING$ construct above, is I did not have to define another string variable, which I thought at first I would have to do. Thus, my program does not have to grow as much, as it's now exceeding 1000 statements, and I'm trying to limit it where ever possible.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was anonymous (and lost) when I submitted the 1st post.
I never tried using the "c" expression in STR$ since I didn't think significant digits would be useful when displaying an integer, and just thought the length descriptor was sufficient.
Ok, I'm going to assume you made a typo. You said STR$(mins%,2,2,1), and I'm going to assume you meant STR$(mins%,2,2), since, according to the manual, STR$ only has an a, b, and c expression. If I'm wrong, let me know
Kevin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
View and moderate all "Help" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
In my app, I have have a timer. I would like it have the format "xx:yy" where x are the minutes and y are the seconds. I have tried many things, but have been unable to get anything to work. I know there are probably ways to do this this within a lot of string variable constructs, but preferring a simpler way, is it possible to use a TEXT command that uses the "USING" comand?
Kevin
Ok, I guess it's ok to answer your own question.
Although this has been gnawing at me for some time, it was not a show stopper, and I had many more problems to fix. And although I have been through the manual over and over many times, my mind is not capable of even understanding most of it, nor large enough to categorize and memorize it. However, yesterday I came across the USING$ command, and it was assigned to a string$ constant. I was familiar with the PRINT USING command from the '70s, but this was the 1st time I had come upon the USING$ command that actually registered as a posible candidate to rectify my situation.
So I tried this: text 425,105,USING$(mins%,"00")+":"+USING$(secs%,"00")
and it worked.
I had prviously tried: text 425,105,STR$(mins%,2)+":"+STR$(secs%,2) and several other things,
but always, the leading zeros disappeared.
The nice thing I like about the USING$ construct above, is I did not have to define another string variable, which I thought at first I would have to do. Thus, my program does not have to grow as much, as it's now exceeding 1000 statements, and I'm trying to limit it where ever possible.
Well,
STR$(mins%,2,2,1)
would also produce leading zeroes.
I was anonymous (and lost) when I submitted the 1st post.
I never tried using the "c" expression in STR$ since I didn't think significant digits would be useful when displaying an integer, and just thought the length descriptor was sufficient.
Ok, I'm going to assume you made a typo. You said STR$(mins%,2,2,1), and I'm going to assume you meant STR$(mins%,2,2), since, according to the manual, STR$ only has an a, b, and c expression. If I'm wrong, let me know
Kevin