SynchronousViewController.borg
SynchronousViewController.borg
{
pagetext:"";
DISP(txt)::pagetext := pagetext + text(txt);
cell(bg,fg,txt)::
{
DISP(" ");
DISP(txt);
DISP(" | ")
};
tr()::DISP("");
rt()::DISP("
");
printmonthtable(persons)::
{
DISP("")
};
respondto(req,line,formdata)::
{
pagetext := "";
printmonthtable(july);
req.display(pagetext);
req.finish();
pagetext := ""
};
createpersonhandler(person)::
{
reqnummer : 1;
handleformdata(formdata)::
{
if (size(formdata) = 4,
{
fromrow:formdata[1];
torow:formdata[2];
staterow:formdata[3];
if ((fromrow[1] = "FROM") & (torow[1] = "TO") & (staterow[1] = "STATE"),
{
l : number(fromrow[2]);
r : number(torow[2]);
if(is_number(l) & is_number(r),
{
if (l < 1,l := 1,false);
if (r > 31, r := 31, false);
if (staterow[2] = "AVAIL", s : 1, s : 0);
while(l < r + 1,
{
l := l + 1;
person[l] := s
})
},false)
},false)
},false)
};
respondto(req,line,formdata)::
{
if (is_table(formdata), handleformdata(formdata), false);
pagetext := "Hello "
+ person[1] + "{" + text(reqnummer);
reqnummer := reqnummer + 1;
pagetext := pagetext + "}
Your current schedule looks like
";
printmonthtable([person]);
pagetext := pagetext + eoln + "