Page 1 of 1

Parameters for LSet(), RSet() , etc.

Posted: Sun Dec 24, 2006 11:20 am
by Psychophanta
Since there exist the format of simple quote like 'A' to refer an ascii value, functions that accepts a unique character as parameter (like LSet() for example) would more sense that it has the ascii value input instead of a string with maximum one character.
Thus, format for these sort of functions would be (in the LSet() as example):
Result$ = LSet(String$, Length [, Character])
instead of
Result$ = LSet(String$, Length [, Character$])

Posted: Sun Dec 24, 2006 11:40 am
by Derek
But it's a string function so it makes more sense the way it is.

If you want to pad a string with letter A's you wouldn't write

a$=rset("hello",20,65)

Posted: Sun Dec 24, 2006 1:28 pm
by lexvictory
and what if for some reason u needed/wanted to use a unicode character in the padding?

Posted: Sun Dec 24, 2006 1:46 pm
by Psychophanta
Derek wrote:a$=rset("hello",20,65)
lexvictory wrote:and what if for some reason u needed/wanted to use a unicode character in the padding?
Well, you would write:

Code: Select all

a$=rset("hello",20,'A')
also for unicode. I don't see any problem, but i see it more elegant.

Posted: Sun Dec 24, 2006 5:32 pm
by Derek
I see your point, it's just that if you have to start remembering single quotes for some commands and double quotes for others then you may start to get more errors than usual. (I get enough errors as it is!)

Posted: Sun Dec 24, 2006 6:21 pm
by Kaeru Gaman
using the Chr()-funktion should be not that bad,
because it' not a funktion-call but an implemented macro (I think)

if you discover that it's not performant enough in loops,
you could use some

Code: Select all

in$ = Chr('A')
before the loop...

in the end it's just a matter of taste...