Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

read

read( 
[ p_inputPort ] 
) 
=> g_result / nil / t

Description

Parses and returns the next expression from an input port.

Returns the next expression regardless of how many lines the expression takes up - even if there are other expressions on the same line. If the next line is empty, returns t. If the port is positioned at end of file, then it returns nil.

Arguments

p_inputPort

Input port. Default is piport.

Values Returned

g_result

The object read in.

nil

When the port is at the end of file.

t

If an empty line is encountered.

Examples

Suppose the file SkillSyntaxFile.il contains the following expressions. A blank line follows the second expression:

define( x 1 )
define( y 2 )
procedure( add( x y ) x+y )
myPort = infile( "SkillSyntaxFile.il" ) => port:SkillSyntaxFile.il" read( myPort )  
=> define(x 1)
read( myPort )
=> define(y 2)
read( myPort )
=> t
read( myPort )
=> procedure((add x y) (x + y ) )
read( myPort )
=> nil
close( myPort )
=> t

Related Topics

lineread


Return to top
 ⠀
X