Page 2 of 3
Posted: Thu Feb 24, 2005 6:24 pm
by Psychophanta
Polo wrote:But what i would like is real tabs

A tab is a tab, no ?
hahaha!
Tab is not a tab. TAB is a key in the keyboard (called console input) which "initially" when pushed first BIOSes interpreted it as an ASCII value "9" inserted. No more.
In general, it should generate the ascii "9", and if you open a notepad .txt file and push TAB key, it write "9" on it. Then notepad program is which interprets each "9" and shows 8 blank spaces instead.
Posted: Thu Feb 24, 2005 6:31 pm
by DoubleDutch
Then it should encode ascii #9 into the source, rather than 2 ascii #32's...
When encountering ascii #9 it should move the cursor forward to the next tab position (not always 2 spaces forward).
Try TAB in word for an example of how TAB should work...
-Anthony
Posted: Thu Feb 24, 2005 6:38 pm
by Psychophanta
DoubleDutch wrote:
When encountering ascii #9 it should move the cursor forward to the next tab position
Ok, but those TAB positions have not a fixed characters lenght nowadays in any decent text editor.
So, where is the problem converting it to a user stablished spaces' numbers ($20) ?
Posted: Thu Feb 24, 2005 7:44 pm
by Blade
Any "modern" editor should give the "real tabs" options. If you get used it's very hard to go back

Posted: Thu Feb 24, 2005 8:00 pm
by Polo
ok, tab is not a tab

BUT, just look in an editor or in World, you'll see that the tab is not interpreted as a few space

Posted: Thu Feb 24, 2005 8:04 pm
by blueznl
tabs date back to the old teletype and typewriter days...
then again, half of you youngsters don't even know the joy of changing an old remmington ink ribbon...

Posted: Thu Feb 24, 2005 8:13 pm
by Psychophanta
blueznl wrote:tabs date back to the old teletype and typewriter days...
Exactly. Computer keyboard is an inheritance of it.
Ok,
Polo, Blade and DoubleDutch,
I understand you prefer TABs chars in your source codes.
And in fact it should be more accurate and precise editor.
Posted: Fri Feb 25, 2005 12:31 am
by DoubleDutch
I have NO complaints about the editor or PureBasic at all, its a really great system for writing code quickly...
But, it would be really nice to have the TAB key act as a TAB key - no a key that just inserts 2 spaces...
-Anthony
Posted: Fri Feb 25, 2005 12:47 am
by aaron
<----------- hates TABS!

I always make my editors place two spaces instead of tabs. If 'real' tabs were added to the purebasic editor, my hope would be that it optional and disabled by default.
By the way, I thought that the editor source was available to hack on. If you really want the tab functionality, why not set about adding it?
Posted: Fri Feb 25, 2005 3:46 pm
by TerryHough
DoubleDutch wrote:But, it would be really nice to have the TAB key act as a TAB key - not a key that just inserts 2 spaces...
As Blueznl reminds us, the TAB key hails back to the typewriter. For those of us old enough and who took a "typing" class instead of a "keyboarding" class, the TAB key was/is designed to cause movement to the next "tab stop" (which was manually set on typewriters).
As such it inserted a variable number of spaces effectively, depending on how far it was from the current location to the next "tab stop". Some editors do have the capability to set "tab stops" at specific locations and save those in the document (See the M$ Office products, specifically Word).
The PB IDE does allow setting of a fixed number of spaces to be inserted when it receives the TAB key. That is actually pretty functional for the limited purposes of the PB IDE. Even if it were possible to set various "tab stops", they wouldn't be very useful in formatting our source code IMHO.
I think what Blade is really saying is that he doesn't like to have to hit the backspace key twice to eliminate the spaces generated by the TAB key.
@Blade, change your PB IDE preferences to 4 spaces per TAB and you can have twice as much irritation backspacing,
Personally, I kind of like the way the TAB works to help me format code in the PB IDE.
However, don't get me started on the asinine way the TAB key was bastardized to move from field to field in Windows by Billy and the M$ engineers. I guess they were confused because keyboards of the time labeled the "Enter" key as the "Return" or "Carriage Return" (again a holdover from typewriters and teletypes). I am still upset that I have to write special code to handle the "Enter" key to accept entries in an input field.
Posted: Fri Feb 25, 2005 4:27 pm
by blueznl
why tabs? i mean, why NO tabs!
load in your program, and reformat code with japbe... i mean, why should *i* reformat my code? let my editor do it!
Posted: Fri Feb 25, 2005 6:38 pm
by Kale
I love tabs!

Posted: Fri Feb 25, 2005 11:23 pm
by ricardo
chr(9) is a Tab, and the editor support it as almost any gadget that support ascii.
Posted: Sat Feb 26, 2005 10:48 am
by freedimension
Well, using Tabs in programming is evil
The reasons are:
1. Changing the width of Tabulators causes the source-code to be reformatted in an unsolicited way.
Example:
You aligned the parameters of Procedures with Tabs
Code: Select all
MyProc(abb, b, 0)
MyProc(a, c, 0)
MyProc(a, djj, 0)
The same would look like this with the double tab width
Code: Select all
MyProc(abb, b, 0)
MyProc(a, c, 0)
MyProc(a, djj, 0)
2. Mixing Tabs and Spaces can lead to problems with formatting in other (peoples) editors.
3. Many external Programs (diff, grep etc.) don't support setting the width of tabs (see 1.).
If you don't believe me, you can read about this in any good book about programming rules. I did and thus don't support that request

Posted: Sat Feb 26, 2005 11:06 am
by blueznl
the only nice use of [tab] in an editor i once saw was smart insertion... when you were at the END of a line and hit [tab] it would look in the source code (looking backwards) for the first comment that sticked out long enough, then align itself with that one (adding spaces) one more tab and it tried to realign itself with another (even further away) comment line etc.
the second interesting use was an editor where [tab] sent you to the comment screen, ie. one worked in a split screen environment, left code, right comments, with tab one would switch
both were industrial applications though, and pretty much tailor made...