10_cndtnl_struct

10_cndtnl_struct - Introduction to Computers and...

Info icon This preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction to Computers and Programming Lecture 10 Recap relational operators are defined number Prof. I. K. Lundqvist Reading: FK pp. 175-182, 193-194, 347-353 Sept 24 2003 • User defined types – Scalar types • Ordered • Each value of a discrete type has a position – Operations on scalar types – Sub-types – Enumeration types – Derived types • Packages – Procedures – Functions – Formal vs. actual parameters
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Scope of Declarations point? subprogram that contains it Visibility procedure P is X : Integer; procedure Q is begin X := 2 ; P.X := 3 end Q; begin Q; end ; A declaration can be hidden from direct visibility, but not hidden from all visibility, and can be accessed using selector syntax: • Where does a given declaration apply? • What declarations apply at a given • Scope of a declaration – From where it is made, to the end of the X : Integer; -- hides outer declaration -- local decl. directly visible ; -- global decl. Visible, -- but not directly
Image of page 2
Visibility type T is (A, B, C, D); procedure P (X : T ); type T1 T; procedure P (X : T1 ); once an inherited declaration is overridden, there is no way to name it: Example 1 with TEXT_IO; use TEXT_IO; 2 3 procedure main is 4 5 length : constant := 4; 7 num : INTEGER; 8 9 10 procedure in INTEGER) is 11 13 14 begin 16 end one; 17 18 is new -- inherited P is visible -- inherited P is hidden from all visibility Some declarations are hidden from all visibility, in particular 6 str : string (1..length); one (num, len : 12 str : string (1..10); -- one 15 ... ... ... ...
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
19 X, Y : FLOAT; 20 21 22 procedure in INTEGER) is 23 24 X : INTEGER; 25 26 begin 28 end two;
Image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern