#73362 - 2003-03-10 02:10 PM
Re: TaskScheduleControl() - comments
|
Glenn Barnas
KiX Supporter
   
Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
|
Jochen:
If PostPrep arbitrarily replaces tabs with 4 spaces, it will only work when the tab is the first character. Consider an editor with tabstops set to 4 spaces: ("+" represents the "tab-space") code:
;+++++++Message, comment and two tabs in front If $a <> 1++++++++++; comment after cmd, 3 tabs ++++DoSomething()+++; comment after cmd, 1 tab EndIf
PostPrep would translate that to: code:
;++++++++Message, comment and two tabs in front If $a <> 1++++++++++++; comment after cmd, 3 tabs ++++DoSomething()++++; comment after cmd, 1 tab EndIf
You can see that this changes the positions of several items, especially comments on the tail end of commands that use tabs to make the comments line up.
A better solution would be to scan the text line, and when a tab is encountered, find the current character position, and add add '$C_Position Mod $TabStop' number of spaces, and then all remaining sequential tabs would just be replaces with $TabStop # of spaces.
I'll wrangle some simple code and post it later.. gotta get the kids to school now.
Glenn [ 10. March 2003, 14:11: Message edited by: Glenn Barnas ]
_________________________
Actually I am a Rocket Scientist!
|
|
Top
|
|
|
|
#73363 - 2003-03-10 02:18 PM
Re: TaskScheduleControl() - comments
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
|
Top
|
|
|
|
#73364 - 2003-03-10 02:46 PM
Re: TaskScheduleControl() - comments
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
It really sounds like we need to put together a consortium.. Call it.. KSI? (KiXtart Standards Institute)..
I agree we should all be on the same page as far as how the code is prestented with TABs and such..
Kent
|
|
Top
|
|
|
|
#73365 - 2003-03-10 03:13 PM
Re: TaskScheduleControl() - comments
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
Disagreed Kent,
for only one reason :
quote: Introduction KiXtart is a logon script processor and enhanced batch scripting language for computers running Windows XP, Windows 2000, Windows NT or Windows 9x in a Windows Networking environment.
The KiXtart free-format scripting language can be used to display information, set environment variables, start programs, connect to network drives, read or edit the registry change the current drive and directory and much more.
KiXtart 2001 (version 4.10) is based on KiXtart 95, and is designed to be fully backward compatible. However, some restrictions apply. Please see the “What’s New” section for full details.
KiXtart 2001 was developed by Ruud van Velsen of Microsoft Netherlands.
{edit} Oh, took accidentially the 4.10 manual, and look, there are curly quotes {/edit} [ 10. March 2003, 15:18: Message edited by: jpols ]
_________________________
|
|
Top
|
|
|
|
#73366 - 2003-03-10 04:06 PM
Re: TaskScheduleControl() - comments
|
Glenn Barnas
KiX Supporter
   
Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
|
Jochen:
There's no mixing of spaces and tabs there (especially in a 'wierdo' way ). I only entered "tabs", and the "+" represented the number of columns that the cursor moved in the editor. If you put a comment character in column 1, then tab twice to move to column 9, arbitrarily converting tabs to 4 spaces would place my text in column 10 instead of 9. (";" plus tab moves to col 5, second tab adds 4 spaces to col 9, where ";" plus two tab chars converted to 8 spaces moves 9 columns, leaving me in col 10)
Basically, tabs move to a particular column, not an arbitrary number of spaces. This is most evident when we use word processors with proportional spacing, but the concept is the same. Program editors generally use fixed width fonts, so it's easy to confuse spaces with column position.
Glenn
_________________________
Actually I am a Rocket Scientist!
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1183 anonymous users online.
|
|
|