Introduction Welcome Getting Started My First Program     Troubleshooting and Distributing Transforming Data Interactive Programs     Programming Exercises     Making Games
Documentation Declarations     Procedures     Variables Statements     Flow Control Expressions Libraries     Print     IO     Random     Game Engine
Tutorials Complete Tutorials     Introduction to Programming     Quick Start     Programming Exercises     Programming Games

LIBRARY: PRINT


All About the Print Library in Vizzcode





About the Print Library

The Print library provide procedures for you to display values of all of Vizzcode's types.

The print procedures only work on console applications - programs that launch (or are launched in) command prompts. In Vizzcode, programs are console applications unless you import the Game Engine library.
Each print procedure receives a value to print of a specific type and with exception of the string type, all print procedures are suffixed by the type them print.




How to Use It

Firstly, you must import the print library:

#import
"Print"

Importing the Print Library in Vizzcode

You can then just call its procedures anywhere in the code. For example:
#import
"Print"


main
:: () {
    
print
(
"Hello, There!"
);
    
print_int
(
456
);
    
print_float
(
12.3
);
}

Examples of the procedures in the Print library





Complete API

print

This is the declaration of the print procedure:
print
:: (message :=
"Hello!\n"
) {

You can call it passing a string value or just use the default value:
#import
"Print"


main
:: () {
    
print
();
    
print
(
"Custom message"
);
    var :
string
=
"Variable"
;
    
print
(var);
}

How to use the print procedure



print_int

This is the declaration of the print_int procedure:
print_int
:: (value :
int
) {

You can call it passing a int value:
#import
"Print"


main
:: () {
    
print_int
(
123
);
    
print_int
(
456
+
789
);
    var :
int
=
10
;
    
print_int
(var);
}

How display numbers in Vizzcode



print_float

This is the declaration of the print_float procedure:
print_float
:: (value :
float
) {

You can call it passing a float value:
#import
"Print"


main
:: () {
    
print_float
(
123
);
    
print_float
(
123.456
);
    
print_float
(
11.22
+
33.44
);
    var :
float
=
10
;
    
print_float
(var);
}

How does the print float procedure work in Vizzcode



print_bool

This is the declaration of the print_bool procedure:
print_bool
:: (value :
bool
) {

You can call it passing a bool value:
#import
"Print"


main
:: () {
    
print_bool
(
true
);
    
print_bool
(
100
<
56
);
    var :
bool
=
"Wolf"
!=
"Lion"
;
    
print_bool
(var);
}

Using the print bool procedure