Results 1 to 10 of 12

Thread: Ascii help / column width - new to this.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Ascii help / column width - new to this.

    Hi guys,

    Before I begin, Uber thanks for any help!!!

    So the scenario is that I'm studying for a degree and we've been asked to look into Pascal due to the rigidity of the language.
    this is my first taste of programming at this level./

    Our current assignment is to reproduce the ASCII table.

    This is low level stuff and I'm very new so bear with me.

    So fair I have this:

    Code:
    program ASCIITABLE(output);
    
    var    i: Integer;
          ch: Char;
    
    begin {main program}
    
          writeln ('A to Z in ASCII');
    
          for i := 01 to 127 do
              begin
                  write ( chr(i ));
                  writeln ('  ', i);
    
              end;
    
          writeln ('Press any key to continue' ,ch);
          read (ch);
    
    end.
    as you can see, fairly basic.
    What I'd like is to set the column width and blank fill with spaces so they are all aligned nicely adn to also set up 6 colums for tyhe code to be displayed in.

    cna anyone help at all?

    huge thanks
    Last edited by WILL; 20-02-2011 at 07:19 PM. Reason: Added code tags to make code more readable.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •