Page 1 of 3 123>
Topic Options
#94898 - 2001-11-08 05:01 PM Welcome MartijnL
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
A warm welcome (and thanks) goes out to MartijnL who graciously agreed to moderate this forum.

A heartfelt thank you to Henri for making it happen.

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#94899 - 2001-11-08 05:06 PM Re: Welcome MartijnL
Anonymous
Unregistered


Thanks Les, and to everyone on the board: post your UDF's!
Top
#94900 - 2001-11-08 05:19 PM Re: Welcome MartijnL
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Excellent - congrats Les and Martijn - ok - so are there any ground rules we should apply to this forum ?

1. Obviously no frivilous posting (and I imagine Martijn has special access to delete off-topic posts ?]

2. One UDF per post ?

3. Should we devise a standard description banner for UDF scripts (I think CJ came up with one) here's a scriptlogic example:

quote:

Action
Returns a verbose representation of a specific date. Example: "April 1st, 2001".

Syntax
VERBOSEDATE ("date")

Parameters
Date must be in the form of "YYYY/MM/DD"

Remarks
Easily internationalized, simply by manipulating
the elements of the $MonthNames array within the function.

Returns
A verbose representation (string) of the date passed to this function.

Dependencies
Ordinal( )

Example
?"Good day, Welcome to the ACME Network."
?"Today is "+verbosedate(@Date)


Source

[the code]


4. Constructive critizisms allowed and Author ammendments reposted to first post in thread ?

I'm sure there's more informal guidelines we can all follow - any thoughts gentlemen ?

5. Do we need a standard post topic format -like :

UDF: DateMath() - Does some funky date math

-Shawn

[ 08 November 2001: Message edited by: Shawn ]

Top
#94901 - 2001-11-08 05:20 PM Re: Welcome MartijnL
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Good luck MartijnL, you may need it.

We should probably have had a discussion about standards before opening this up. Things like:

  • UDF Naming
  • Documentation
  • Variable names
  • Function calling conventions
  • Variable scope rules

A common format would make UDFs easier to understand, especially with the diversity of nationalities on this board.

We should also think about the etiquette of this forum, as it should probably be less informal than the existing ones. This forum should contain finished UDFs and nothing else. See, I've already breached the etiquette with this post

There are other problems, like dealing with comments, requests for improvements, bug fixes and removing / updating obsolete versions.

All-in-all a big task.

Top
#94902 - 2001-11-08 05:24 PM Re: Welcome MartijnL
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Yes - variable scope rules - VERY IMPORTANT !!! Variable names could be anything as long as they have local scope ! Global variables should have a stnadrd - and well documented !!!

-Shawn

Top
#94903 - 2001-11-08 05:35 PM Re: Welcome MartijnL
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
This udf design thing was already intended(?) by cj (at least I made all my external udf after this convention since then)

goes something like this (sample from DeltaTime())

code:

;FUNCTION DeltaTime()
;
;AUTHOR Jochen Polster (jochen.polster@gmx.net)
;
;ACTION Calculates the time difference between two given times
;
;SYNTAX DeltaTime(Start,End)
;
;PARAMETERS Start (Required)
; - String value representing the starttime
; Format hh:mm:ss[:ms]
;
; End (Required)
; - String value representing the ending time
; Format hh:mm:ss[:ms]
;
;REMARKS Highest possible delta Value is 23:59:59:999 !
; If the diff gets higher , the result will be incorrect.
;
;RETURNS The difference between Start - and Endtime in 'hh:mm:ss[:ms]'
;
;DEPENDENCIES None
;
;EXAMPLES call "PATH\DeltaTime.udf"
; $start = @time + ':' + @msecs
; for $i = 0 to 15000
; $ = @scriptdir
; next
; $end = @time + ':' + @msecs
; ? 'Start time : $start' ?
; ? 'End time : $end' ?
; $Duration = DeltaTime($start,$end)
; ? 'Duration : $Duration' ? ?
;
; $start = "21:59:59" ? 'Backup Started : $start' ?
; $end = "01:00:01" ? 'Backup Ended : $end' ?
; $d = DeltaTime($start,$end)
; ? 'Backup Duration : $d' ?
;
; get $k

Plus we should have an udf-internal-variables convention , maybe just like Richard once used :

udf internal starts with $__ or something like that


J.

_________________________



Top
#94904 - 2001-11-08 06:09 PM Re: Welcome MartijnL
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
All variables used inside a UDF should be DIM'ed so that they are local to the UDF only.

All information passed back out from a UDF should be passed via the return variable (UDF name).

This way the internal workings of UDF can not interfere with the calling script, no matter what variable names were used.

Bryce

Top
#94905 - 2001-11-08 06:13 PM Re: Welcome MartijnL
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
Does UBB have to option of always making a specified topic the first one on the list?

So we can place the rules and guidelines of this forum always at the top.

Top
#94906 - 2001-11-08 06:17 PM Re: Welcome MartijnL
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
However, you may want to keep state information between function calls.

Think of how the DIR() funcion works. The logic of the function needs to retain state information so that subsequent calls return the next value. Local variables are destroyed and so are not usable in that context.

Ruud has said that there will be static variables which will perform the task but these are not there yet.

You may also need variables which need to be visible between UDFs which make up a function library. Again, these need to be global, at least within the file that the functions are defined.

Top
#94907 - 2001-11-08 06:21 PM Re: Welcome MartijnL
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
good point, i hadn't thought of that.

Bryce

Top
#94908 - 2001-11-08 06:24 PM Re: Welcome MartijnL
Alex.H Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 406
Loc: France
For the Kix UDF desing, i suggest to add the kixtart version. Actually not needed, but with future version, we'll see new command within, or changed behavior

Bryce : Ubb has this feature (Sticky : topic) , only for moderator.
And need to see if the version on kixtart.org have it

Anyway, good luck to MartijnL, he will really need it

Off-Topic : Shawn, did you receive my latest mail about KixWinVB ? I used your provide address on your kix-profile, but as your are also consultant, i hope i was good when i send it to you

_________________________
? getobject(Kixtart.org.Signature)

Top
#94909 - 2001-11-08 07:59 PM Re: Welcome MartijnL
Anonymous
Unregistered


Tomorrow I'll try to gather the rules in one message, so it's clear for everyone what they are. Till tomorrow, keep posting things to think of.

For now, I'm going to study , cause saturday I have an exam about databases.

Top
#94910 - 2001-11-08 08:13 PM Re: Welcome MartijnL
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I'll suggest another "thing" we'll need (maybe documented in the rules thingy) is the protocol for posting code and the "howto" for properly downloading code ... that is to say something like:

1. Posted UDF's should be wrapped in [code][/code] tags

2. To download UDF's, cut and paste the lines between code: tags into MS Write (WordPad) and save as textfile with a .kix extention ...

You get what I mean - point being that lot's of folks (myself included) haven't quite got this download script thingy (with perserved formatting) nailed just yet ... has anybody worked-out a fool proof method ?

-Shawn

[ 08 November 2001: Message edited by: Shawn ]

Top
#94911 - 2001-11-08 08:22 PM Re: Welcome MartijnL
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
Shawn, I use Word2000 not Wordpad.

The ability to store UDF's as a plain text file would be a very nice thing.

This is why, if i can, i give a link to the UDF stored on my personal site, for easy download.

Bryce

Top
#94912 - 2001-11-08 11:23 PM Re: Welcome MartijnL
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
Shawn I also use Word 97,2000, XP all seem to work fine. Copy Paste into Word, then Copy Paste into your text editor.

I think Jochen or CJ posted that, I can't remember now who it was, but it works great.

Yes, it would be nice if UBB had other options though. I'm sure not everyone has MS Word

Top
#94913 - 2001-11-09 12:16 AM Re: Welcome MartijnL
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
The copy/paste/copy/paste thingy through WordPad works on my Win2k flavor as it does through Word2k. See INFO - Ripping code from postsfor other suggestions as well.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#94914 - 2001-11-09 01:36 AM Re: Welcome MartijnL
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
Cool! A UDF forum!

I changed "Dependancies" to "Requires" because "Dependancies" is too long. It was stuffing up my margins in my Doc. I haven't released said doc yet either.

I will watch this forum and start posting some UDFs soon. I might have to tweak them for RC3/4 though.

As for the DIR thing, I would suggest that someone make a UDF that does a full dir and returns an array with the information. Perhaps a 2D array with file size, time, date etc etc...

cj

Top
#94915 - 2001-11-09 01:42 AM Re: Welcome MartijnL
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
how about have the dir return an array of object handles for each file?

$files = dir()

for each $file in $files
? $file.name
? $file.size
...
next

Bryce

[ 09 November 2001: Message edited by: Bryce ]

Top
#94916 - 2001-11-09 05:12 AM Re: Welcome MartijnL
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Congratulations everybody.
A very old request is now available.
Only the way of "how to publish scripts" will become first a very nice discussion.
So we must also find a way how to reference to old scripts without copy those topics to this forum.
Other input will come later.
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#94917 - 2001-11-09 02:12 PM Re: Welcome MartijnL
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Perhaps the UDF forum should be made a read only forum, which works something like this...

When you have a new UDF, post it to the normal forum (scripts) with a title of
"[UDF] Announce: Bread Slicing function"
It can then go through the usual peer review, testing, bug fixing etc.

When it becomes completely stable, mail Martijnl and ask him to promote it to the UDF forum. At this point he can check that the standards have been adhered to and post it to this forum. Perhaps we can find him some disk space somewhere where he can store a disk version and create a reference link.

That way you'd keep all the noise out of the forum.

Top
Page 1 of 3 123>


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

Who's Online
0 registered and 323 anonymous users online.
Newest Members
Audio, Hoschi, Comet, rrosell, PatrickPinto
17880 Registered Users

Generated in 0.126 seconds in which 0.071 seconds were spent on a total of 13 queries. Zlib compression enabled.

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