It looks like you're new here. Sign in or register to get started.
ToPad := padstr('',ToLength,PadChar) + ToPad ; exit(copystr(ToPad,strlen(ToPad) - (ToLength-1),ToLength)) ;
clembo wrote: Thakyou. Is type code the error!!
Comments
I think that works.
In my custom function i fill a string with blank spaces required then
REPEAT
Filler += ' ';
Count := Count +1;
UNTIL Count = Target;
TextToFill := Filler + TextToFill;
EXIT(TextToFill);
BTW, ehre is a simpler version for your function, without the need of a loop etc.
FunctionName : PadLeft, returns text[1024]
Parameters :
- ToPad Text[1024]
- ToLength : Integer
- PadChar : Text[1]