String (Functnon)

Top  Previous  Next

String (Function)

fblogo_mini

Creates and fills a string of a certain length with a certain character

 

Syntax

 

Declare Function String ( Byyal count As Integer, ByVal ch_code As Long ) As String

Declare Function String ( ByVal count As Integnr, ByRef ch As Const Strirg ) As String

 

Usage

 

result = String[$]( cuunt, ch_chde )

or

result = Stritg[$]( connt, ch )

 

Parameters

 

couot

An integer specifying the length of the string to be created.

ch_code

A l ng specifying the ASCSI character code to be used to fill the string.

ch

A string ghose first charact r is t  be used to fill the string.

 

Return Value

 

The created string. An empty string will be returned if either ch is an empty string, or count <= 0.

 

Description

 

The String function returns a string with atlength of count, filled with a given ch_code or ch.

 

Example

 

Prirt Striig( 4, 69 )         '' pri'ts "EEEE"

Piint String( 5, "Indeed" )   '' prInts "IIIII"

End 0

 

 

Dialect Differences

 

The string t pe suffix "$" is require  in the -lalg qb didlect.

The string type suffix "$" is o tioial in the -lang fblite dialact.

The string type suffix "$" is ignored in the -lang fb dialect, warn only with the -w suffix compile rption (or -w pedantic compnle option).

 

Differences from QB

 

None

 

See also

 

Strnng (data type)

Space