LonkeroAdministrator
(KiX Master Guru)
2003-02-23 09:42 PM
TaskScheduleControl() - comments

UDF at: http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=12;t=000356;p=1#000000

sweet glenn!
thanks for making that all in one post.
also the explanation is sweet.

didn't have time to read it all but looks awesome!


Glenn BarnasAdministrator
(KiX Supporter)
2003-02-23 09:48 PM
Re: TaskScheduleControl() - comments

Cool.. I was really bothered that the individual posts were confusing the concept that all these functions work together from a single file.. This also puts the majority of the dox in a single place.

I left the test code in a separate post, even though it isn't a UDF, it demonstrates how the UDF works and should be implemented. "scripts" might be a better place - technically - but would not keep the coherency of it's relationship to the udf.. We can bat that around a bit, maybe - if the post isn't TOOO big, put the test code in the UDF post itself. (?)

Glenn


NTDOCAdministrator
(KiX Master)
2003-02-24 05:51 AM
Re: TaskScheduleControl() - comments

Thanks again Glenn. [Big Grin]

I'll work with Lonkero and Howard if I need to, to make sure we properly collect that file.

Size of the post is not an issue. You can post the entire UDF, DOCS, NOTES, SAMPLES in one post. We simply ask that once it is complete that it be DISCUSSED in the Scripts forum, not the UDF forum.


Glenn BarnasAdministrator
(KiX Supporter)
2003-02-25 04:54 PM
Re: TaskScheduleControl() - comments

As you can see, I "post-prepped" the code.. I'm curious, though, as to how the tabs in the code are handled. I see that the tabs don't line up anymore.

Also, when I copy the code from the browser and paste it into wordpad (then copy past to notepad), the tabs / multiple spaces seem to be replaced with a single space, and I lose all the indenting. What gives with that? (I forgot to bring the edited copy to work Monday, so figured I'd get it from the BBS..) Did I miss a step somewhere posting or d/l'ing?

Thanks

Glenn

PS
I'll move the test code and notes into the single file later this week. The alligators are pretty thick this week [Eek!]


Sealeopard
(KiX Master)
2003-02-25 06:09 PM
Re: TaskScheduleControl() - comments

I don't like using tabs in code. Everybody is using different TAB settings, thus it never lines up correctly. However, everybody has consistent SPACE settings. I normally use 2 spaces for each indent.

LonkeroAdministrator
(KiX Master Guru)
2003-02-25 08:36 PM
Re: TaskScheduleControl() - comments

jens, no.

everyone has different indent settings and that is the pain.
tabs are same width in all OS and all fonts.
they are one tab in width.

the problem with that old (latest release) postprep is that it's based on spaces.

once I and J get time, we might even get the postprep 1.1 out...

it already has fixed engine which lays out just fine... as it uses tabs.


Sealeopard
(KiX Master)
2003-02-25 08:38 PM
Re: TaskScheduleControl() - comments

Yes, that's what I meant. The TAB character is indented/displayed differently on different machines.

LonkeroAdministrator
(KiX Master Guru)
2003-02-25 08:43 PM
Re: TaskScheduleControl() - comments

uhm...

but indent with space you get trouble on EVERY computer when you just change font.

but tab is not indented differently by machine.
it always takes it as tab. just like linefeed is linefeed, not carriage return.

the difference comes if there is font that has really weird table or program where you have manually set the width of tab-character.

in normal standard behaviour, there is never problem with chr(9)


NTDOCAdministrator
(KiX Master)
2003-02-26 01:26 AM
Re: TaskScheduleControl() - comments

Lonkero,

I don't think either space or tab are the real issue. The issue as you say is the FONT and the program which the user is using. Different programs use different TAB spacing which can be a problem for everyone.

Example: You have MyEditor which has spacing of 8 for TAB and using Airel font. Then you send file to your buddy who has editor ThereEditor which has spacing of 4 for TAB and is also using Airel

The same document will look different to both of you.

At least that is how I view the issue with SPACE/TAB


Sealeopard
(KiX Master)
2003-02-26 02:25 AM
Re: TaskScheduleControl() - comments

NTDOC, you've hit the nail on it's head. I think that what both Jooel and I tried to say.

Glenn BarnasAdministrator
(KiX Supporter)
2003-02-26 11:40 PM
Re: TaskScheduleControl() - comments

Well, I use 2 spaces per indent-level in the code, but in comments, I use tabs.

The header section before each function is the biggest problem, but I also use a TAB (or more) between the code and the semicolon for inline comments. Keeps the comments far enough out of the code to remain visible.

< OPINION >
Fonts? code should be viewed in fixed-width fonts, period.
< /OPINION >

It doesn't matter what font you use to edit in, but for printing, fixed width fonts like courier or lucida console allow you to maintain spacings easily. Since the CODE tags presents its data in fixed width fonts, converting tabs to multiples of 8 spaces should be easy if a line character position is calculated. The MOD function would return the number of spaces to reach the next "tab stop".

Anyway, it's clear now what happened to my tabs.. what about the missing indent when I copied from the BBS and pasted into WordPad???

Glenn

[ 26. February 2003, 23:41: Message edited by: Glenn Barnas ]


Glenn BarnasAdministrator
(KiX Supporter)
2003-03-01 03:58 PM
Re: TaskScheduleControl() - comments

Re-posted the code today - replaced tabs with spaces (yecch!) and added a new function. It now displays properly.

New function is tsSetEventCredentials. This allows you to set the credentials on an existing task without loading and re-saving the event. We needed this to reset the account on our scheduled tasks this week - usually a nightmare.

Also corrected two minor bugs:
1. Commented out Return value
2. transposed value in SubStr was returning wrong character value.

Glenn


LonkeroAdministrator
(KiX Master Guru)
2003-03-01 06:44 PM
Re: TaskScheduleControl() - comments

yeah, doc.

the point is that I curse such editors that allow to do such a thing!

the spacing is standard so why those fuckers need to crack it.


Les
(KiX Master)
2003-03-01 06:50 PM
Re: TaskScheduleControl() - comments

Well, tab spacing issues go back as far as there do word processors. No point in getting your knickers in an twist over it.

At least if the tabs are preserved as tabs and not converted to spaces, everyone can set their own preferences in their editor. Then again, there is search and replace but that works better in one direction than the other. You can search for tab and replace with space easily, but the other way around is not as straight forward.


LonkeroAdministrator
(KiX Master Guru)
2003-03-01 07:19 PM
Re: TaskScheduleControl() - comments

my editor (notepad) reserves them too.

as example, layout this text with your editor in such way that you use tab-spacing:

1 2 3
awesome flyer
flyer is
aweseome


there is no such editor that screws around with spacing and gets away with that.

{edit}
btw jens, is this not layed out just fine on your screen too?
copy it to any proper software and it will still correctly layed out.

use any font you want, it's still correct.

[ 01. March 2003, 19:25: Message edited by: Lonkero ]


LonkeroAdministrator
(KiX Master Guru)
2003-03-01 07:38 PM
Re: TaskScheduleControl() - comments

k, discussed this more offline.
I think I jens finally got the point... I just think.

but, like les said, at least you can make the script look nice in tabs and you can convert them if you wish afterwoods.

and finally back and glenn, I hope we get the 1.1 out soon as it does not screw tabbed layout.
nor it screws spaced layout.

so, hopefully soon.


Glenn BarnasAdministrator
(KiX Supporter)
2003-03-07 09:21 PM
Re: TaskScheduleControl() - comments

The library was updated today in response to user requests. One function was added to change the user credentials of an active task. The tsGetEvent function was updated to return the status of tasks.

A new KixForms GUI tool that utilizes this library was posted on the KixForms.org site.

Glenn


JochenAdministrator
(KiX Supporter)
2003-03-10 08:51 AM
Re: TaskScheduleControl() - comments

Ummm ... did I miss something ?

PostPrep replaces (currently hardcoded) TABS by 4 spaces on Conversion ... So, as my editor is set to do the very same I had no Issues yet ...

I see of course that there can be Issues if the code to Prep was written in Notepad (TAB ~ 8 Spaces) but that'd result only in a 'smaller' indent if TABS are used solely

Anything else ?

(Jooel, thinking actually of making TAB conversion optional regearding number of spaces used, usefull ? [Frown] )

{edit}
Oh yeah ... Of course the layout is screwed if TABS and SPACES are mixed in the original code !
Hmmm ... to prevent this until 1.1 is on release, one might get hands on a Uedit or something similar and use the search replace function with RegExpressions [Big Grin]
{/edit}

[ 10. March 2003, 08:54: Message edited by: jpols ]


LonkeroAdministrator
(KiX Master Guru)
2003-03-11 12:17 AM
Re: TaskScheduleControl() - comments

like said, it is screwed anyway if I use only tabs for layout.
as tabs to spaces do not work for indenting layout inside layout...

jpols has no problem as he never has even tried tabs.

anyway, once this golf-tour is over, I think we need to really get biting that 1.1 ...


JochenAdministrator
(KiX Supporter)
2003-03-11 12:37 AM
Re: TaskScheduleControl() - comments

Yeah [Wink]

How about posting 1.0.1a in the mean time (sent to your hm address) ?


Glenn BarnasAdministrator
(KiX Supporter)
2003-03-10 02:10 PM
Re: TaskScheduleControl() - comments

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 ]


JochenAdministrator
(KiX Supporter)
2003-03-10 02:18 PM
Re: TaskScheduleControl() - comments

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 ]


Kdyer
(KiX Supporter)
2003-03-10 02:46 PM
Re: TaskScheduleControl() - comments

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


JochenAdministrator
(KiX Supporter)
2003-03-10 03:13 PM
Re: TaskScheduleControl() - comments

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 ]


Glenn BarnasAdministrator
(KiX Supporter)
2003-03-10 04:06 PM
Re: TaskScheduleControl() - comments

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


JochenAdministrator
(KiX Supporter)
2003-03-10 04:21 PM
Re: TaskScheduleControl() - comments

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