Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411516 Posts in 69380 Topics- by 58436 Members - Latest Member: GlitchyPSI

May 01, 2024, 07:58:15 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Retarded Pascal stuff.
Pages: [1]
Print
Author Topic: Retarded Pascal stuff.  (Read 1326 times)
shig
Guest
« on: May 03, 2010, 03:31:11 PM »

So someone decided that FOR SOME REASON I should learn Pascal. So my teacher told me to do some pretty basic programs and send it to him.

But, um... For some reason the compiler hates me. If I try to program using another computer it works just fine, but I have tried to do this incredibly simple program and the compiler tells me nothing but "COMPILATION ABORTED".
Here's what I have so far:
(The program is small and incomplete right now because I just wanted to test to see if I got the factoring right)
PROGRAM SEQUENCIA;

USES CRT;

VAR

N : INTEGER;

BEGIN
 READLN (N);
 WRITELN EXP(N * LN(2));
 READLN;
END.


So... What the hell is going on?? Is it my computer? I haven't tried coding this exact program on another computer yet.
Logged
Mikademus
Level 10
*****


The Magical Owl


View Profile
« Reply #1 on: May 03, 2010, 03:39:43 PM »

Your compiler simply disapproves of ALL-CAPS. Or it believes it to be FORTRAN code Well, hello there!

Seriously though, that program looks ok. Granted, it has been quite a few years since I last did Pascal, but to me it looks like it should compile. Have you tried FreePascal?
Logged

\\\"There\\\'s a tendency among the press to attribute the creation of a game to a single person,\\\" says Warren Spector, creator of Thief and Deus Ex. --IGN<br />My compilation of game engines for indies
shig
Guest
« Reply #2 on: May 03, 2010, 03:56:42 PM »

This was all done using FreePascal. :/
Logged
Christian Knudsen
Level 10
*****



View Profile WWW
« Reply #3 on: May 03, 2010, 05:38:07 PM »

You need parenthesis around the EXP(N * LN(2)) part:

WRITELN(EXP(N * LN(2)));
Logged

Laserbrain Studios
Currently working on Hidden Asset (TIGSource DevLog)
shig
Guest
« Reply #4 on: May 03, 2010, 06:30:08 PM »

You need parenthesis around the EXP(N * LN(2)) part:

WRITELN(EXP(N * LN(2)));
Apparently it was something with my computer.

I did this exact same thing on my neighbour's computer and it just told me there was something wrong, instead of "COMPILATION ABORTED". So I found this exact thing you just pointed out and fixed it, and then it worked. I did everything else there, and saved on my pendrive.
Logged
Mikademus
Level 10
*****


The Magical Owl


View Profile
« Reply #5 on: May 04, 2010, 12:32:05 AM »

You need parenthesis around the EXP(N * LN(2)) part:

WRITELN(EXP(N * LN(2)));
Lol, can't believe I missed that! And I made my first games in Pascal! :D
Logged

\\\"There\\\'s a tendency among the press to attribute the creation of a game to a single person,\\\" says Warren Spector, creator of Thief and Deus Ex. --IGN<br />My compilation of game engines for indies
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic