I have been getting several messages from people on the internet needing help with Pascal programming. I have decided to make this series to answer some of these questions. I cannot guarantee that I will answer the questions sent.
Questions can be sent via Youtube Personal Message
The first video is in response to a question from a user in Lithuania. The user writes:
I want to do something like this: "enter something" then user types (e.g. "Monday") and then he knows what lessons is on Monday. You know, what I mean?
Video: Pascal Helper Series Video 1 - Menus (5:05)
The code for the menu program in this tutorial:
program CaseMenu;
{$mode objfpc}{$H+}
uses
crt,
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes
{ you can add units after this };
var
sel:char;
begin
clrscr(); {use the crt unit}
writeln(' 1) Monday');
writeln(' 2) Tuesday');
writeln(' 3) Wednesday');
writeln(' 4) Thursday');
writeln(' 5) Friday');
writeln(' 6) Saturday');
writeln(' 7) Sunday');
writeln;
write(' Please Make A Selection: ');
readln(sel);
writeln;
writeln;
case sel of
'1' : begin
writeln(' Assignment for Monday');
end;
'2' : begin
writeln(' Assignment for Tuesday');
end;
'3' : begin
writeln(' Assignment for Wednesday');
end;
'4' : begin
writeln(' Assignment for Thursday');
end;
'5' : begin
writeln(' Assignment for Friday');
end;
'6' : begin
writeln(' Assignment for Saturday');
end;
'7' : begin
writeln(' Assignment for Sunday');
end;
end; {Case Statement}
writeln;
writeln;
writeln(' Press <Enter> To Quit');
readln;
end.
