Page 1 of 1

Show string length in StatusBar during coding

Posted: Tue Nov 20, 2007 1:58 pm
by PB
You know how the StatusBar shows the command syntax when typing a
command (eg. MessageRequester), it'd be nice when typing a literal string
for the StatusBar to show it's length.

So if I typed this so far in the editor...

Code: Select all

Debug "hello
...then the StatusBar could show "String length: 5" or similar. Because when
using the Left, Right and Mid commands, you often have to specify a length
for them, which means counting the string manually yourself.

What I mean is, let's say I've coded the following line...

Code: Select all

If Left(a$,)="how long is this string"
...you can see that I then have to count all the characters in the string by
myself, and then type that number after the comma. I hate doing that.
It'd be nice to have the editor count it as I type the string, so when I'm
done typing I can see the length and just go back and type the number
after the comma. Does that make sense?

Posted: Tue Nov 20, 2007 2:36 pm
by case
why not using the len() command a bit tricky but works fine?

Code: Select all

    a$="i'm too lazy to count the len of this awfull freaking long string so i ask fred another feature for pure basic"
    tmp$="i'm too lazy to count the len of this awfull freaking long string":If Left(a$,Len(tmp$))=tmp$
          Debug "omg that's right i don't need that ^^"
    EndIf
well but adding that feature to the ide may be also a good idea ^^

Posted: Tue Nov 20, 2007 2:39 pm
by Foz
another method would be to show length in characters the amount of selected text in the status bar.

It should be easy as well if the editor gives you a SelectionLength function.

Posted: Tue Nov 20, 2007 6:04 pm
by freak
Lol, i find myself counting characters when coding quite a few times as well :)

I don't like the string length idea so much though. With it we would loose the ability
to see the parameter of a function that we are typing when typing a literal string
as parameter.

I'll add the length of the selection to the statusbar as Foz suggested i think.
With the current position, like this: "Line: 123 Column: 4 Selection: 23"

Posted: Tue Nov 20, 2007 7:47 pm
by DoubleDutch
Thats a great idea. I will also add that to Elementary Reports. :)