Language and interpreter
Is DECLARE optional?
In this compiler, yes for simple variables. The first assignment or INPUT creates the name, and the type is inferred from that value. Count <- 0 and INPUT Name both work without a DECLARE line.
Undeclared arrays are also created if you index them (Scores[1] <- 10 allocates a 1-indexed array with a large upper bound). Prefer an explicit DECLARE Scores : ARRAY[1:n] OF INTEGER so bounds match the question.
Cambridge papers still expect DECLARE. Use it in practice and in exams. Optional declaration is a convenience of this interpreter, not a mark-scheme feature.
Are THEN and DO required?
THEN after IF / ELSEIF is optional. DO after WHILE is optional. IF x > 0 on one line and a body below still parses.
Write them anyway in assessed work. Mark schemes show IF … THEN and WHILE … DO.
Are keywords and names case-sensitive?
Keywords are case-insensitive: IF, if and If are the same. So are OUTPUT, DECLARE, PROCEDURE, CLASS, and the rest.
Variable names are case-sensitive: Total and total are different.
Record and class member names are case-insensitive, because Cambridge materials mix FirstName / Firstname.
Can I use = instead of <- ?
Assignment accepts both <- (the Cambridge form) and =. Comparison also uses = / <> / < / > / <= / >=.
Prefer <- for assignment so it is obvious which = is a test. :=, var, let and print are not IGCSE syntax; the error messages point you back to DECLARE / OUTPUT.
Are arrays 1-indexed?
Yes, unless you DECLARE different bounds. DECLARE Names : ARRAY[1:30] OF STRING is the usual IGCSE form. 2D arrays use ARRAY[1:rows, 1:cols].
This compiler does not support arrays of arrays (an array whose element type is another array). Use a 2D array instead.
What A Level (9618) features are included?
User-defined types (TYPE records, enums, pointers ^x / ptr^, SET OF + DEFINE), DATE with dd/mm/yyyy literals, CASE ranges (1 TO 5 :) and multi-value labels, BYREF / BYVAL (sticky across following parameters), random-access files, and OOP (CLASS / ENDCLASS, INHERITS, PUBLIC / PRIVATE, NEW, SUPER).
See the syntax guide for worked examples. IGCSE students can ignore the A Level section; the extra keywords will not get in the way of 0478 programs.
Why does DECLARE Date : STRING still work?
Most A Level words are soft keywords. In a variable-name position the parser treats TYPE, SET, DATE, RANDOM, NEW, CLASS, SEEK, DEFINE, INHERITS, PUBLIC, PRIVATE, BYREF, BYVAL, GETRECORD and PUTRECORD as ordinary identifiers.
SUPER, ENDTYPE, ENDCLASS and the older IGCSE keywords stay reserved. Type and class names themselves are still hard identifiers.
Can I write Python, Java or Portugol instead?
No. This is Cambridge pseudocode. print(), console.log, var / let, and Brazilian Portugol words (escreval, leia, fimse) produce student-friendly errors that name the IGCSE equivalent.
If you need Python, use the Python view after writing pseudocode — do not paste Python into the editor.
Can an IF or loop body be empty?
Yes. Comment-only or empty IF / loop bodies parse and run as no-ops. That matches starter scaffolds that leave // … for you to fill in. A literal ... placeholder in starter code is flagged with a “replace the placeholder” hint.
Does each statement need its own line?
Newlines are significant. Put one statement per line. Putting ENDIF or OUTPUT on the same line as the previous statement is a common parse error; the message will say the keyword must be on its own line.