Oops.

The problem is caused by the way I've used RND(). Normally RND(ceiling) implementations return a random number which is between 0 and ceiling-1, in other words the modulo of ceiling, or in some cases between 1 and ceiling. KiXtart returns a value between 0 and ceiling, which is a little unusual.

In the password generator UDF this would occasionally cause it to read past the end of the $sSelectFrom string, adding a blank character.

The fixed version follows:


Function udfPWGen($iLength,Optional $sSeed)
Dim $sTerminal,$sNonTerminal,$iIndex,$iSeed

$sTerminal=$sTerminal+"BCDFGHJKLMNPQRSTVWXYZ"
$sTerminal=$sTerminal+"bcdfghjklmnpqrstvwxyz"
$sNonTerminal="0123456789"
For $iIndex=1 To Len($sSeed)
$iSeed=$iSeed+Asc(SubStr($sSeed,$iIndex,1))
Next
Srnd($iSeed*@monthno)
For $iIndex=1 to $iLength
$sSelectFrom=IIF($iIndex=1 OR $iIndex=$iLength,$sTerminal,$sTerminal+$sNonTerminal)
$udfPWGen=$udfPWGEn+Cstr(Substr($sSelectFrom,(Rnd(Len($sSelectFrom)-1)+1),1))
Next
EndFunction



Serves me right for not reading the manual properly.