|HOME |ABOUT |ARTICLES |ACK |FEEDBACK |TOC |LINKS |BLOG |JOBS |


Tutorials



EXTEND


Is Also



"is also" is used for extending existing method/TCM. When we use "is also" it adds new lines of code/functionality after the existing code as shown in below example.



EXAMPLE:
<'

struct exam {
from_exam() is {
out ( "This is BASE" );
};

};

struct e_exam like exam{
from_exam() is also {
out( "This is EXTENDED" );

};

};

extend sys {
exam : exam;
e_exam : e_exam;
run() is also {
exam.from_exam();
e_exam.from_exam();
};

};
'>


RESULT:

This is BASE
This is BASE
This is EXTENDED


Is First




"is first" is used for extending existing method/TCM. When we use "is first" it adds new lines of code/functionality before existing code shown in below example.



EXAMPLE:
<'

struct exam {
from_exam() is {
out ( "This is BASE" );
};

};

struct e_exam like exam{
from_exam() is first {
out( "This is EXTENDED" );

};

};

extend sys {
exam : exam;
e_exam : e_exam;
run() is also {
exam.from_exam();
e_exam.from_exam();
};

};
'>


RESULT

This is BASE
This is EXTENDED
This is BASE


Is Only



"is only" is used for over riding existing method/TCM. When we use "is only" it over rides the existing code/functionality before existing code and replaces with new code as shown in below example.



EXAMPLE:
<'

struct exam {
from_exam() is {
out ( "This is BASE" );
};

};

struct e_exam like exam{
from_exam() is only {
out( "This is EXTENDED" );

};

};

extend sys {
exam : exam;
e_exam : e_exam;
run() is also {
exam.from_exam();
e_exam.from_exam();
};

};
'>


RESULT:

This is BASE
This is EXTENDED

Index
Introduction
E Basics
Data Types
Operators
Struct
Units
List
Methods
Concurrency Actions
Constraints
Extend
When And Like
Events
Temporal Expressions
Temporal Operators 1
Temporal Operators 2
Synchronizing With The Simulator
Wait And Sync
Physical Virual Feilds
Packing N Unpacking
Pre Run N On The Fly
Coverage
Commands
Extendable Methods
Non Extendable Methods
And Gate Evc

Report a Bug or Comment on This section - Your input is what keeps Testbench.in improving with time!





<< PREVIOUS PAGE

TOP

NEXT PAGE >>

copyright © 2007-2017 :: all rights reserved www.testbench.in::Disclaimer