Your Digital Media Has Never Looked So Good

 
lumpenprole
Topic Author
Posts: 15
Joined: Wed Apr 22, 2015 10:37 am

Potential bug on StrI()

Wed Apr 22, 2015 10:40 am

So, it seems that StrI() introduces a leading whitespace, whereas ToStr() does not. Just thought I'd let someone know.
 
User avatar
RokuKC
Posts: 315
Joined: Wed Sep 10, 2014 10:44 am
Location: Roku HQ

Re: Potential bug on StrI()

Wed Apr 22, 2015 11:01 am

 
belltown
Posts: 1465
Joined: Thu Dec 09, 2010 1:43 pm
Contact:

Re: Potential bug on StrI()

Wed Apr 22, 2015 11:11 am

lumpenprole wrote:
So, it seems that StrI() introduces a leading whitespace, whereas ToStr() does not. Just thought I'd let someone know.

I don't think I've ever used Strl(), for that reason.
https://github.com/belltown/
 
User avatar
Komag
Posts: 808
Joined: Fri Aug 22, 2014 3:42 am

Re: Potential bug on StrI()

Wed Apr 22, 2015 11:47 am

When you print to console, it apparently uses StrI(), so I'm in the habit of avoiding spaces since it will add one, such as:
PRINT "x is" x ", y is" y
instead of
PRINT "x is " x ", y is " y
 
User avatar
TheEndless
** Valued Community Member **
Posts: 9231
Joined: Mon Oct 04, 2004 10:15 am
Location: US
Contact:

Re: Potential bug on StrI()

Wed Apr 22, 2015 12:54 pm

The extra space is for the sign. If you use it on a negative integer, there won't be an empty space. I almost always use .ToStr(), but you could always wrap the StrI()/Str() call in a Trim() to strip the white space.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)

Who is online

Users browsing this forum: No registered users and 13 guests