# I'm new and learning, need help (Pascal)

Page 1 of 1

## 3 Replies - 735 Views - Last Post: 21 August 2017 - 10:52 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'https://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=405895&amp;s=4c96451620492439bc41f8eee56c8e77&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 b17g

Reputation: 0
• Posts: 2
• Joined: 21-August 17

# I'm new and learning, need help (Pascal)

Posted 21 August 2017 - 10:04 AM

Have a *** of a program here and have no idea why line 19 is giving syntax error

```Program calculator;

// s = soma
// u = subtrair
// m = multiplicar
// d = dividir
// n1 = numero 1
// n2 = numero 2
// b = bystander

Uses crt;

Var s : integer;
u : integer;
m : real;
d : real;

BEGIN
Procedure mais;
begin
b := n1 + n2;
Writeln(B)/>/>/>;
end;

Procedure menos;
begin
b := n1 - n2;
Writeln(B)/>/>/>;
end;

Procedure vezes;
begin
b := n1 * n2;
Writeln(B)/>/>/>;
end;

Procedure dividir;
begin
b := n1 / n2;
Writeln(B)/>/>/>;
end;

Writeln("What's the operation?");
Writeln("1) +");
Writeln("2) -");
Writeln("3) *");
Writeln("4) /");
Writeln("Select the number of the operation you wish to conduct");
Writeln("And now, the second number");
If b=1 then
mais;
Else
If b=2 then
menos;
Else
If b=3 then
vezes;
Else
If b=4 then
dividir;
Else
Writeln("Non-available operation");
End.
```

That's the program, the error is in line 19
(The site also wouldn't allow me to put attachment />/>)
P.S. The sunglasses smileys are (b.) without the "."

This post has been edited by andrewsw: 21 August 2017 - 10:33 AM
Reason for edit:: added missing [code][/code] tags

Is This A Good Question/Topic? 0

## Replies To: I'm new and learning, need help (Pascal)

### #2 andrewsw

• Bouncy!

Reputation: 6562
• Posts: 26,614
• Joined: 12-December 12

## Re: I'm new and learning, need help (Pascal)

Posted 21 August 2017 - 10:34 AM

Please wrap your code in code tags, it shows how to do this directly in the area where you type your post. I have added them for you.

Is your line 19 "Procedure mails;" as it is in the posted code? And what is the error message? Quote it exactly.

I have also removed the profanity, there is no need for this, particularly on your first post.

### #3 b17g

Reputation: 0
• Posts: 2
• Joined: 21-August 17

## Re: I'm new and learning, need help (Pascal)

Posted 21 August 2017 - 10:38 AM

Free Pascal Compiler version 3.0.0 [2015/11/20] for x86_64
Target OS: Linux for x86-64
Compiling jdoodle.pas
jdoodle.pas(19,6) Error: Illegal expression
jdoodle.pas(19,16) Fatal: Syntax error, ";" expected but "identifier MAIS" found
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode

### #4 andrewsw

• Bouncy!

Reputation: 6562
• Posts: 26,614
• Joined: 12-December 12

## Re: I'm new and learning, need help (Pascal)

Posted 21 August 2017 - 10:52 AM

I haven't touched Pascal for years. I suspect that the procedure should be outside of the Begin on line 18, which begins the program. a ref

You might wait a little while for a Pascal-er to surface.

Page 1 of 1

 .related ul { list-style-type: circle; font-size: 12px; font-weight: bold; } .related li { margin-bottom: 5px; background-position: left 7px !important; margin-left: -35px; } .related h2 { font-size: 18px; font-weight: bold; } .related a { color: blue; }