dimanche 1 décembre 2019

Semicolon Error in If-Then-Else Statement

I faced a problem like this. Before this code, I'm not using repeat-until statment and I faced no error(s). After I add repeat-until statement into this code, I faced this problem. This is my code:

repeat
    begin
        if (pc = 1) then
            begin
                // Anything
            end
        else if (pc = 2) then
            begin
                write('Insert: '); readln(ukck);
                ukck := upcase(ukck);

                repeat
                    begin
                        if (ukck = 'M') then
                            begin
                                harga := 225000;
                            end
                        else if (ukck = 'L') then
                            begin
                                harga := 250000;
                            end
                        else if (ukck = 'XL') then
                            begin
                                harga := 300000;
                            end
                        else
                            writeln('Tidak ada di dalam katalog.');
                    end
                until (ukck = 'M') or (ukck = 'L') or (ukck = 'XL');
        else
            write('Input tidak valid. Mohon masukkan 1 atau 2 saja');
    end;
until (pc = 1) or (pc = 2);

And I get:

Fatal: Syntax error, ";" expected but "ELSE" found

Anything wrong?

Aucun commentaire:

Enregistrer un commentaire