Hello,
I was following a tutorial that I dug up online. I entered in an example code and kept getting a newline after printing the subject and not sure what to fix.
Here's the code:
program exRecords;
uses crt;
type
Books = record
title : packed array[1..50] of char;
author : packed array[1..50] of char;
subject : packed array[1..100] of char;
book_id : longint;
end;
var
Book1, Book2 : Books; {Declare book1 and book2 of type Books}
begin
{book1 specification}
Book1.title := 'C Programming';
Book1.author := 'Nuha Ali';
Book1.subject := 'C Programming Tutorial';
Book1.book_id := 6495407;
{book2 specification}
Book2.title := 'Telecom Billing';
Book2.author := 'Zara Ali';
Book2.subject := 'Telecom Billing Tutorial';
Book2.book_id := 6495700;
{print book1 info}
writeln('Book 1 title: ', Book1.title);
writeln('Book 1 author: ', Book1.author);
writeln('Book 1 subject: ', Book1.subject);
writeln('Book 1 book id: ', Book1.book_id);
writeln;
{print book2 info}
writeln('Book 2 title: ', Book2.title);
writeln('Book 2 author: ', Book2.author);
writeln('Book 2 subject: ', Book2.subject);
writeln('Book 2 book id: ', Book2.book_id);
readkey;
end.
I'm running this on windows 7 64 bit using Lazarus 1.4.
Than ks,
Septe