[futurebasic] Re: [FB] STR# Char

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 1999 : Group Archive : Group : All Groups

From: Joe Lewis Wilkins <PepeToo@...>
Date: Tue, 05 Oct 1999 16:21:35 -0700
Anders wrote:

>> How about...
>> Tp$ = LEFT$(STR# (217,gTheArmyID%), 4)
>>
>> Is this really the answer you were looking for?
>
> Don't forget that when you do the STR$(217,gTheArmyID%) that it puts a space
> on the left, so you need to take 5 chars with LEFT$ and drop the first one or
> do MID$(STR$(217,gTheArmyID%),2,4) instead; if that is really what Jim is
> looking for!
>

Whoops! I guess I shouldn't have answered this one since I never use str$.

Hi Anders (and Jim),

Jim was polite enough to let me know (in private) that my "instead" above gives an
Error and well it should. It's a surprise that my modification worked, since I
read STR# as STR$; which, obviously, isn't used to return a String from a Resource
File. STR$ only takes one argument (some value, which it converts and adds a space
or a minus sign in front of it - which ever is appropriate); whereas STR# takes
two arguments - the resource id and the index number into that resource.

So, Double Whoops and egg on MY face! I have no idea why changing the 4 in Anders
code to a 5 made it work; except that, by change, Jim's data was five chars long
rather than the 4 he said/thought it was.

So Triple Whoops! Have a good evening to all!

Joe Wilkins