No need for built-ins, you can add this functionality very easily to you own libraries.

The UDF library below shows the simplest method, with no parameter checking.

It is very easy to add code to parse the file and perform parameter checking, and/or automatic help text if the function is called incorrectly.

As an example, if you save this script as "demolib.udf" you can include it in a main script as you normally would, or call the functions directly from the command line using someingthing like:
Code:
kix32 demolib.kix $__UDF="udfGreeting" $__P1="Good morning" $__P2="Richard"



Because there is no parameter checking, if you specify too many or too few parameters KiXtart will fail with not very helpful error messages.

The only other caveat of course is that if you have a global variable $__UDF defined in you main script when you call the library it will attempt to call the UDF. You can also protect against this, but it is pretty unlikely to occur.

Code:
; UDF library calling demo.

; This sample script shows how to write a KiXtart library to allow functions to be called
; arbitrarily from the command line as well as from scripts.

; This is the simplest version, with no parameter checking or help

Function udfDemo()
"Called function udfDemo_1 OK" ?
Exit 0
EndFunction

Function udfGreeting($sTimeOfDay,$sUserName)
$sTimeOfDay+" "+$sUserName+", welcome to the ACME network."+@CRLF
Exit 0
EndFunction

;---------------------------------------------------------------------------------------------
; Stand-alone function call.
; This code is executed when the library is called with $__UDF set.
; This is intended to allow the library functions to be called directly
; from the command line.
If IsDeclared($__UDF)
BREAK ON
$=SetOption("Explicit","ON")
Dim $iParamIndex,$sParams,$sQuote
$sQuote='"'
$iParamIndex=1
While Execute("Exit IsDeclared($$__P"+$iParamIndex+")")
$=Execute("$$sParams=$$sParams+','+$$sQuote+$$__P"+$iParamIndex+"+$$sQuote")
$iParamIndex=$iParamIndex+1
Loop
Exit Execute($__UDF+"("+SubStr($sParams,2)+")")
EndIf

; vim600: filetype=kix ts=4 sw=4 ai fdc=4 fdm=marker