how to make a text edit - Programmers Heaven

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.

how to make a text edit

kakcankakcan Posts: 2Member
this is my home work.please..

Comments

  • protektorprotektor Posts: 116Member
    heh, well this is pretty long to explain.

    read the keyboard output, save it in a buffer, and display the buffer.

    [code]
    type
    ptrrec = record
    seg,offs:word;
    end;
    var
    ch:char;
    p:pointer;

    begin
    getmem(p,64000);

    repeat
    ch:=readkey;
    if (ch<>ESC_CODE)and(ch<>BACKSPACE) then begin
    move(p^,ch,1);
    inc(ptrrec(p).offs);
    DisplayBufToScreen(p);
    end;
    if (ch=BACKSPACE) then begin
    dec(ptrrec(p).offs);
    ch:=#0;
    move(p^,ch,1);
    end;
    until ch=ESC_CODE;
    end.
    [/code]

    now this is just a short exemple, writting a whole editor here would be long. I have 2 text editor that I made in pascal. if you want them, tell me, i'll mail them.

  • ManningManning Posts: 1,621Member
    : this is my home work.please..

    It would be better if you tried writing the program yourself, and if you run into difficulties then come here and ask specific questions. You're message makes it sound as if you want someone to write the program for you, which isnt what this board is for.

  • protektorprotektor Posts: 116Member
    : : this is my home work.please..
    :
    : It would be better if you tried writing the program yourself, and if you run into difficulties then come here and ask specific questions. You're message makes it sound as if you want someone to write the program for you, which isnt what this board is for.
    :


    i'm sorry, my offer sounds awfully generous ;). I trust that people will try to understand from my codes if I send it to them, but when you think of it, some people might not try to learn.

    If you have any specific questions about a specific part of the text editor, ask 'em and we'll answer


  • kakcankakcan Posts: 2Member
    "read the keyboard output, save it in a buffer, and display the buffer"

    i did nt understand this words exactly..
    and how will i use BACKSPACE and ESC_CODES string in code?

Sign In or Register to comment.