Please enable JavaScript to view this site.

A-Shell Reference

FILL$(expr,length)

The FILL$ function returns a string expression made by repeating the source expression until it reaches the specified overall length (in bytes).

For example:

PRINT FILL$("ab-",10)     ! displays "ab-ab-ab-a"

Note that the source expression may contain nulls, which generally only makes sense if assigning the output of the function to an unformatted variable. For example, the statement REC = FILL$(chr(0),sizeof(REC)) would fill the REC variable or structure with nulls.

FILL$ requires COMPIL switch /X:1 or higher.

History

2024 May, A-Shell 7.0.1757:  Optimize the FILL$() function, achieve a 10x improvement when used with single-character patterns (not that anyone will notice!)