Page 2 of 2 <12
Topic Options
#73362 - 2003-03-10 02:10 PM Re: TaskScheduleControl() - comments
Glenn Barnas Administrator Offline
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! \:D

Top
#73363 - 2003-03-10 02:18 PM Re: TaskScheduleControl() - comments
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Glenn,

I see what you mean, but consider that the average Codewriter (even a starter) doesn't mix Tabs with spaces that weirdo way [Wink]

Well, anyway I think the discussion here leads to nothing as Jooel and me predictably will find the one or other night to get pressure on version 1.1 which will be a completely different thing [Razz]

[ 10. March 2003, 14:21: Message edited by: jpols ]
_________________________



Top
#73364 - 2003-03-10 02:46 PM Re: TaskScheduleControl() - comments
Kdyer Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#73365 - 2003-03-10 03:13 PM Re: TaskScheduleControl() - comments
Jochen Administrator Offline
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 [Eek!] [Big Grin] {/edit}

[ 10. March 2003, 15:18: Message edited by: jpols ]
_________________________



Top
#73366 - 2003-03-10 04:06 PM Re: TaskScheduleControl() - comments
Glenn Barnas Administrator Offline
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 [Wink] ). 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! \:D

Top
#73367 - 2003-03-10 04:21 PM Re: TaskScheduleControl() - comments
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
yap !

Therefore my Uedit converts Tabs to spaces while typing, Or by a macro that waits to be executed when I open others scripts [Wink]

We (Joeel and me) will definetly consider this though when fixing the engine of PP 1.1
_________________________



Top
Page 2 of 2 <12


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1183 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.067 seconds in which 0.036 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org