BBC BASIC for Windows
« TAB Key »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 10:35pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: TAB Key  (Read 751 times)
mohsen
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 39
xx TAB Key
« Thread started on: Nov 5th, 2008, 1:31pm »

Why is the TAB key inactive in the IDE window? undecided

User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: TAB Key
« Reply #1 on: Nov 5th, 2008, 3:42pm »

Quote:
Why is the TAB key inactive in the IDE window?

What would you expect it to do? Indentation is automatic (and you're not allowed to have 'leading blanks' on a line) so it's not obvious to me what useful functionality it could have.

There's not even any way that TAB could insert the right number of spaces to align to a particular column (it would have to know by how much the line was going to be indented, which might depend on something after the TAB you haven't yet typed....).

I'm open to (practical) suggestions for something useful to do with that key, but I've not thought of anything up to now.

Richard.
User IP Logged

mohsen
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 39
xx Re: TAB Key
« Reply #2 on: Nov 5th, 2008, 5:30pm »

Here is an example:

Code:
      MS%=filestore%                    :REM MS%=memory start of file
      DS%=Offset%                       :REM DS%=address start for display
      REM PROCdebug(MS%)
      ME%=MS%+limit%                    :REM ME%=memory end of file
      DE%=DS%+limit%                    :REM DE%=address end of file for display
      M%=MS%                            :REM M%= current actual memory position
      D%=DS%                            :REM D%= current display Address position
      SMS%=MS%                          :REM SMS%=first memory address of 1st line of current screen
      SDS%=DS%                          :REM SDS%=first display address of 1st line of current screen
      SME%=SMS%+TotalLines%<<2          :REM SME%=last line of displayed (memory)
      SDE%=SDS%+TotalLines%<<2          :REM SDE%=last line of displayed (displayed)
      line%=0                           :REM start line
      VDU23,128,24,24,24,24,24,24,24,24 :REM define char 128
      PROCcreate_addresses
      PROConescreen(0,TotalLines%,SMS%,SDS%):PROCdisplay_pos
 


When writing a well documented and well commented code, you need that to be easily readable.

Currently the above space before the REM has to be inserted by hitting the space bar which is time consuming and counter-productive.

The TAB key has a purpose in all Editors. It is the first time I come across a Professional Programme Eitor that suggests that the TAB key is an accessory on the keyboard :)

You can define the TAB key to insert a default number of spaces say 8 (user configurable).
And, as a smart add-on to that, the TAB key will also move (by inserting spaces) to the position equal to the column of the previous line next colon ":" or semi-colon (in case of assembler) position. As stored tokens expand to different keyword lengths, the code to do the positioning is not staright forward as with plain text. But is doable and has been done before.

User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: TAB Key
« Reply #3 on: Nov 5th, 2008, 10:13pm »

Quote:
The TAB key has a purpose in all Editors.

It's had no purpose in the BB4W editor for more than seven years, and I can't remember anybody else having drawn attention to it!

Quote:
And, as a smart add-on to that, the TAB key will also move (by inserting spaces) to the position equal to the column of the previous line next colon ":" or semi-colon (in case of assembler) position.

As I explained, I believe that to be virtually impossible, not just difficult! To work out how many spaces to add it is necessary to know by how much the line will be indented. The amount by which it is indented may change as a result of something you type after pressing TAB.

So for that to work, either it needs a time machine to look into the future (!), or it would have to 'backtrack' and modify the number of inserted spaces after the rest of the line is typed.

Anyway, it's a moot point. The program editor is so complex and difficult (even for me) to understand, that I wouldn't dare make such a major alteration for fear of introducing a bug.

No doubt it would be possible (and relatively safe) to configure the TAB key to insert a fixed number of spaces (say 8) but it's not something I plan to do.

Richard.
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: TAB Key
« Reply #4 on: Mar 3rd, 2009, 09:24am »

Quote:
No doubt it would be possible (and relatively safe) to configure the TAB key to insert a fixed number of spaces (say 8) but it's not something I plan to do

In BBC BASIC for Windows version 5.90a the TAB key can be programmed to execute an editor macro. A utility (SETTAB.BBC) is provided to program it to move the cursor to a specified column, with the proviso mentioned earlier in the thread that it won't work correctly if the indentation changes.

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls