What is wrong with my if-statement?

; is not allowed before else in the majority of cases. if ((input=”y”) or (input=”Y”)) then begin writeln (‘blah blah’); end else if ((input=”n”) or (input=”N”)) then begin writeln (‘blah’); end else begin writeln (‘Input invalid!’); end; will compile. But… Prefer using begin … end brackets to avoid misunderstanding of code in complicated if then … Read more

Pascal, Delphi Linked lists [closed]

Something like this: type TOccurencyNodePtr = ^TOccurencyNode; TOccurencyNode = record Occurency: integer; Next: TOccurencyNodePtr; end; TIdentifierFoundNodePtr = ^TIdentifierFoundNode; TIdentifierFoundNode = record Identifier: string; Next: TIdentifierFoundNodePtr; end; var Occurencies: TOccurencyNodePtr = nil; Identifiers: TIdentifierFoundNodePtr = nil; procedure AddIdentifierOccurency(const Identifier: string; const Occurrency: Integer); var IdentifierNode, LastIdentifierNode: TIdentifierFoundNodePtr; OccurencyNode, LastOccurencyNode: TOccurencyNodePtr; begin IdentifierNode := Identifiers; LastIdentifierNode := … Read more