Page 1 of 1

String() command in addition to Space() command

Posted: Mon Sep 15, 2003 9:12 pm
by oldefoxx
Space(n) allows you to create a string of n spaces. How about a String(n,x) command to create as string of whatever X is, which would usually be a character code, but might also be a character constant, or it might be a string of one or more characters to be returned n times.

Re: String() command in addition to Space() command

Posted: Tue Sep 16, 2003 2:42 am
by PB
I'd like this too -- I needed it just the other day, actually. :)

Posted: Tue Sep 16, 2003 9:45 am
by GPI
Try: LSet("",10,'*')

Btw: Other language can do this
a$="hallo"*2
debug a$ ; you get "hallohallo"

GPI

Cleaver Feature

Posted: Wed Sep 17, 2003 4:09 am
by oldefoxx
That is cute. Just use a$=LSet("".100."*") and you get a line of 100 astericks. Note your example was not quite complete, and the use of
single quotes to surround the "*" character was invalid. I am sure you
know better, but it might mislead someone else. It also works with RSet() as well. I will have to remember that. Still, as String() command would be more obvious, consistent with soem other BASICs, and have more flexability.

I personally would not care to see the abitlity to perform a$*2 as a wqy to couble a string, since a might have been defined as a.s, and a*2 would not be obvious as a string doubling function, but rather look like a math operation.