Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Help needed with turbo pascal units

KhunalKhunal Posts: 3Member
hi
i'm rather new to pascal. it's the second year that i'm studying it at school. i would like help with units:
what are they? (no,really)
how are they used?
what are they capable of?

any help would be appreciated
thank you

Khunal Ramesar

Comments

  • ibyiby Posts: 323Member
    : hi
    : i'm rather new to pascal. it's the second year that i'm studying it at school. i would like help with units:
    : what are they? (no,really)
    : how are they used?
    : what are they capable of?
    :
    : any help would be appreciated
    : thank you
    :
    : Khunal Ramesar
    :


    Units are collections of routines which are likely
    to be reused. For example, to write line of text
    on screen is actually not so simple. To make it easier
    some guys at Borland created write and writeln procedures.
    For putting pixel on the screen you have PutPixel, etc.
    Those are just some examples of basic routines
    that are used all the time in many many projects.
    To make them available, Borland programmers have included
    them into files caled units (libraries).
    So PutPixel for example is part of GRAPH unit (graph.tpu).
    To use it, all you have to do is tell to your compiler where
    to find it:

    [code]
    program test;
    uses graph;


    begin
    initgraph... { switch to graphic mode)


    putpixel... ( put a dot on screen )

    closegraph... ( end graphic mode }
    end. [/code]

    Iby
  • viv.viv. Posts: 72Member
    ok if u dont have any USES .... this means that u are running with only 1 default compulsory unit, system.tpu. Each unit allows new reserved words for different task (e.g. system.tpu allows intructions like write,read,repeat,etc) Other units will generally give you more options for your program, that is a program that is capable of more things.
    PS. u need to download most.
    check your help in pascal search for graph, this is a unit,download it , its good.


    btw. u from india?




Sign In or Register to comment.