#21582 - 2002-05-10 10:41 PM
using UDF is script
|
j95661
Getting the hang of it
Registered: 2001-02-27
Posts: 84
Loc: sacramento,ca usa
|
I have seen some examples of UDF code for doing more advanced functions in Kix... But I cant find a doc on how to use this UDF code, where does it go. It looks like standard VB code.. can anyone point me to a doc.
gracias...
_________________________
WonderBoy
Constantly learning everyday, how much I dont know :-)
|
|
Top
|
|
|
|
#21583 - 2002-05-10 10:49 PM
Re: using UDF is script
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
In the FAQ forum:How to use UDFs [ 10 May 2002, 22:51: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#21584 - 2002-05-10 11:09 PM
Re: using UDF is script
|
New Mexico Mark
Hey THIS is FUN
  
Registered: 2002-01-03
Posts: 223
Loc: Columbia, SC
|
Have you read the "Function" command section in the kix2001.doc file? That sums it up pretty well.
You could also look at some of the UDF's posted here and / or in http://www.scriptlogic.com/Kixtart/FunctionList.asp
Beyond that, just create a small script and a simple function like (untested code):
code:
function LastFirst ($strName) ; $strName is assumed to be a string with first ; middle (optional) and last names, and no ; punctuation, titles, or Jr, Sr, etc. dim $Tmp, $Name, $i, $j $Tmp = split($strName,' ') $j = UBound($Tmp) $LastFirst=$Tmp[$j] $LastFirst=$LastFirst + ',' for $i = 0 TO ($j - 1) $LastFirst=$LastFirst + ' ' $LastFirst=$LastFirst + $Tmp[$i] next endfunction
Silly example, but it would be something easy to play with. Just put that code into a text file. Then anywhere outside the function/endfunction boundaries, you could put:
code:
LastFirst('First MI. Last') ?
Run the script, and play with it until you are comfortable with how functions work. Maybe you could add an optional parameter to include a title.
New Mexico Mark
|
|
Top
|
|
|
|
#21585 - 2002-05-22 11:35 AM
Re: using UDF is script
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,
We create on daily basis summary pages with UDFs from the "kixtart.org" and "www.scriptlogic.com" site. Also the FAQ forum from this site is transfered to summary page.
related addresses On all HTML summary pages you have a direct link to interesting topic. Based on this new input we have also update our program for creation the right information for you. You can read now, which functions are new or updated.
The Scriptlogic site has restyle the functionlib page. A very usefull facility is: scriptlogic can mail you all required function in KiXtart format Example for Abs is:
code:
;--[ Function: Abs() ]----------(last revised: 2001/12/11)- ; ; ;- Action: ; ; Mathematical absolute value. ; ; ;- Syntax: ; ; ABS (Expression) ; ; ;- Parameters: ; ; Expression (Required / String) ; a number or numerical expression. ; ; ;- Remarks: ; ; None ; ; ;- Returns: ; ; Returns the absolute value of the expression. ; ; ;- Example: ; ; $result=abs(-3) ; ; $x=10*10-145 ; $result=abs($x) ; ;
function abs($Expr) ;returns the absolute value of a number $Expr=0+$Expr if $Expr<0 $Expr=-1*$Expr endif $abs=$Expr endfunction
greetings.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 823 anonymous users online.
|
|
|