Hi cadey, welcomeDoing this is not a simple thing ... if your running KiXtart version 4.0, might want to consider making a UDF out of this ...
Set $variable to a string and any length and this script will convert it into a fixed-length variable of (in this case) 20 chars ... if the variable is too big, it will be trunctated ... if the variable is too small - it will be paddded with spaces (from the $fixedmask string) ... anyone got a better way of doing this ?
code:
break on
$variable = "kixtart"
$fixedmask = " " ; set this to be a string of spaces of fixed length
$fixedvariable = substr($variable,1,len($fixedmask))+substr($fixedmask,1,len($fixedmask)-len($variable))
?"fixedvariable=$fixedvariable len=" len($fixedvariable)
exit 1
-Shawn[ 22 November 2001: Message edited by: Shawn ]