Please enable JavaScript to view this site.

thinBasic Help Manual

Navigation: ThinBASIC Modules > Console

Console_WriteLine

Scroll Prev Top Next More

* * 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

 

Write text followed by carriage return and line feed to the console screen.

 

Syntax

 

Console_WriteLine(sText [, sText2 [, ...]] [In lColor] [At x, y]) [( ... ) [(...)])

 

Returns

 

Return a number

If the function succeeds, the return value is nonzero and is the number of bytes written.

If the function fails, the return value is zero.

 

Parameters

 

Name

Type

Optional

Meaning

sText

String

No

The text to print

lColor

Number

Yes

If present, text attribute will be changed before writing text. See standard console color equates

x

Number

Yes

If present, cursor location will be moved to x before writing text

y

Number

Yes

If present, cursor location will be moved to y before writing text

 

Remarks

 

Text is written from the current cursor position and with the current attribute.

This function is similar to Console_Write except that the cursor position is always moved at the beginning of new line.

 

Optional lColor and optional cursor position are temporary and changed only for the execution of the function:

before start writing text, current color and cursor position are saved

text writing takes place

previous color and old position are restored

 

Parenthesis are optional.

 

Multiple blocks of text/color/position can be indicated into a single command just putting them into a () pairs

 

Restrictions

 

Alias

 

Console_PrintLine

PrintL

 

See also

 

Console Module, Console_Read, Console_Write, StdOut

 

Examples

 

Uses "Console"

 

'---Bright cyan text on a blue background

Long cBrightCyanBGBlue  = %CONSOLE_FOREGROUND_BLUE | %CONSOLE_FOREGROUND_GREEN | %CONSOLE_FOREGROUND_INTENSITY | %CONSOLE_BACKGROUND_BLUE

Long cBrightRed         = %CONSOLE_FOREGROUND_RED | %CONSOLE_FOREGROUND_INTENSITY

 

Long lCount

Long lColor1, lColor2

 

lColor1 = cBrightCyanBGBlue

lColor2 = cBrightRed

 

For lCount = 1 To 30

 

  '---Changing of color and cursor position will effect only current Printl

  Print lCount, "Hi there" In lColor1  At 25 + lCount, lCount

  Print lCount, "Hi there" In lColor2  At 25 + lCount, 31 - lCount

  

  '---Firing other Printl are not effected from previous color and curso position

  PrintL lCount, "Hi there"

 

  Swap lColor1, lColor2

Next

 

WaitKey

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