Show string length in StatusBar during coding

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Show string length in StatusBar during coding

Post 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?
case
Enthusiast
Enthusiast
Posts: 141
Joined: Thu Aug 07, 2003 11:09 am

Post 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 ^^
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Post 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.
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post 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"
quidquid Latine dictum sit altum videtur
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Thats a great idea. I will also add that to Elementary Reports. :)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Post Reply