Please enable JavaScript to view this site.

thinBasic Help Manual

* * HELP & MANUAL PREMIUM PACK 4 DEMO VERSION * *

This documentation was styled with a demo skin from the Premium Pack 4 add-on for Help & Manual. The contents of the skin are encrypted and not configurable. You can only publish HM projects with this skin. You cannot edit it or change it.

This version is copyright and may only be used for local testing purposes. It may not be distributed.

Please purchase the full version of the Premium Pack to get the configurable skins and remove this notice. The package will also include the Toolbox configuration utility for Premium Pack skins.

 

Description

 

Return a string containing a centered (padded) string.

 

Syntax

 

s = CSET$(StringExpression, StrLen [USING PadString])

 

Returns

 

String

 

Parameters

 

Name

Type

Optional

Meaning

StringExpession

String

No

The string expression to format

StrLen

Number

No

Len of the resulting string

PadString

String

Yes

If present, first char of PadString will be used as padding char, otherwise spaces will be used.

 

Remarks

 

Restrictions

 

See also

 

String Handling, LSET$, RSET$,

 

Examples

 

Thanks to Abraxas for the following script example

' Usage of the LSET$ Keyword example

' Usage of the CSET$ Keyword example

' Usage of the RSET$ Keyword example

 

Dim MyOLDString  As String VALUE "HELLO WORLD"

Dim MyLSETString As String

Dim MyCSETString As String

Dim MyRSETString As String

Dim sMsg         As String

 

MyLSETString = LSET$(MyOLDString, Length+10 USING "*"

MyCSETString = CSET$(MyOLDString, Length+10 USING "*"

MyRSETString = RSET$(MyOLDString, Length+10 USING "*")

 

sMSG += "Strings Padded with * " & $CRLF & $CRLF 

sMsg += "Normal " & MyOLDString  & $CRLF & $CRLF

sMsg += "LSET$ "  & MyLSETString & $CRLF & $CRLF

sMsg += "CSET$ "  & MyCSETString & $CRLF & $CRLF

sMsg += "RSET$ "  & MyRSETString & $CRLF & $CRLF

 

MSGBOX 0, sMsg

 

 

 

Created with Help+Manual 8 and styled with Premium Pack Version 4 © by EC Software