#105496 - 2003-10-04 04:32 AM
Re: what is UDF?
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
A UDF is a better subroutine construct with the ablility to have a return value like a function and set @error.
|
|
Top
|
|
|
|
#105498 - 2003-10-04 05:04 AM
Re: what is UDF?
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
A user defined function (UDF) is defined by the function...endfunction commands. The code placed in the UDF body should perform some valuable task.
A UDF is a better subroutine construct than gosub...return. It has the ability to return value like a function. Also, by using the "exit" command to leave the function, you can set the value of @error to the value passed to the exit comand as in "exit 87".
|
|
Top
|
|
|
|
#105500 - 2003-10-04 06:18 AM
Re: what is UDF?
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Good topic of discussion!
Coming from the world of VB, I think of a UDF like an include. That is, a library of sorts that you can refer to later on in your code. A UDF can be simple or complex..
One way to think of this is something like a routine to "build a chair" where single commands would piece it together. If you are on the fence on going from 3.x to 4.x of KiXtart, it's beauty is that you can simplify, compact your current code without losing functionality. In our companys example, I was able to trim down from 102KB Login script to about 60KB and can be trimmed down further.
Kent
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 657 anonymous users online.
|
|
|