|
|
|||||||
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! |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
Thanks again Glenn. 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. |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
Yes, that's what I meant. The TAB character is indented/displayed differently on different machines. |
||||||||
|
|
|||||||
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) |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
NTDOC, you've hit the nail on it's head. I think that what both Jooel and I tried to say. |
||||||||
|
|
|||||||
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 ] |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
my editor (notepad) reserves them too. as example, layout this text with your editor in such way that you use tab-spacing:
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 ] |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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 ? ) {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 {/edit} [ 10. March 2003, 08:54: Message edited by: jpols ] |
||||||||
|
|
|||||||
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 ... |
||||||||
|
|
|||||||
Yeah How about posting 1.0.1a in the mean time (sent to your hm address) ? |
||||||||
|
|
|||||||
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:PostPrep would translate that to: code: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 ] |
||||||||
|
|
|||||||
Glenn, I see what you mean, but consider that the average Codewriter (even a starter) doesn't mix Tabs with spaces that weirdo way 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 [ 10. March 2003, 14:21: Message edited by: jpols ] |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
Disagreed Kent, for only one reason : quote:{edit} Oh, took accidentially the 4.10 manual, and look, there are curly quotes {/edit} [ 10. March 2003, 15:18: Message edited by: jpols ] |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
yap ! Therefore my Uedit converts Tabs to spaces while typing, Or by a macro that waits to be executed when I open others scripts We (Joeel and me) will definetly consider this though when fixing the engine of PP 1.1 |