Free Pascal Help

darkRae

Ueki Fan (Ueki is watching you)
Reaction score
173
I've been learning Pascal (we use Free Pascal) for a while, and I've got some questions here:

1) At some point I was trying to compile a really simple, even just a few lines (just checking something) but it always returned an error message: "Error: Error while Linking"

Anybody knows what it is? How to solve it?

2) I haven't found a function to convert an integer into string or vice versa.
What are they?

Thanks.

EDIT:
Turns out that my folder which contained Free Pascal was named "PascalFree" and then I renamed it to "Pascal Free" and the first problem was solved.
What's the meaning of this?
 

Xorifelse

I'd love to elaborate about discussions...........
Reaction score
87
I've been learning Pascal (we use Free Pascal) for a while, and I've got some questions here:

1) At some point I was trying to compile a really simple, even just a few lines (just checking something) but it always returned an error message: "Error: Error while Linking"

Anybody knows what it is? How to solve it?

2) I haven't found a function to convert an integer into string or vice versa.
What are they?

Thanks.

EDIT:
Turns out that my folder which contained Free Pascal was named "PascalFree" and then I renamed it to "Pascal Free" and the first problem was solved.
What's the meaning of this?

I believe, those functions you seek are:
1. http://www.delphibasics.co.uk/RTL.asp?Name=StrToInt
2. http://www.delphibasics.co.uk/RTL.asp?Name=IntToStr

And Free Pacal is a little bit.. strange to work with.
You'ed have to configure it then it works.

However, you'd probably be better off with another IDE.


Also, a great way to learn your "Pascal" is done with "Scar DIVI"
It is a macro program that executes pascal ( delphi ) scripts.
 

Sintoras

Shaaakaa!
Reaction score
45
I'd try Delphi. Same thing but newer.

The thing with linker, I guess there was a file which the linker needed in that folder, the path was probably hardcoded so it just didn't find the file--> error.
 

darkRae

Ueki Fan (Ueki is watching you)
Reaction score
173
Do Delphi functions work in Free Pascal?
Or they are 100% the same thing?

Thanks guys.
Never knew why I didn't think of searching using Google o_O
 

monoVertex

I'm back!
Reaction score
460
Late answer, but no, those functions Themis linked are not supposed to work in Pascal. I mean, Pascal != Delphi. Maybe there are a lot of syntax similarities, but that doesn't makes them the same.
 

enouwee

Non ex transverso sed deorsum
Reaction score
240
Code:
PROGRAM Test;

VAR str    : String[32];
    i, pos : Integer;

BEGIN
Writeln('Enter something, preferably a number:');
Readln(str);

Val(str, i, pos);
IF (pos <> 0) THEN
  Writeln('That wasn''t a number!')
ELSE BEGIN
  Write('Your input as integer: ');
  Write(i);
  Writeln
END;

END.
 

darkRae

Ueki Fan (Ueki is watching you)
Reaction score
173
Smith_S9 said:
but that doesn't makes them the same.

Explains why StrToInt() and IntToStr() returned an error XD

What is the third parameter in val() actually? (in this case, 'pos')
 

Xorifelse

I'd love to elaborate about discussions...........
Reaction score
87
Late answer, but no, those functions Themis linked are not supposed to work in Pascal. I mean, Pascal != Delphi. Maybe there are a lot of syntax similarities, but that doesn't makes them the same.

There is little to no difference between Delphi and "Object Pascal".
Pascal is merely a scripting language but was later improved to an object orientated language called "Object Pascal", then sometime later they changed the name to Delphi.

As for the IDE you're better of using CodeGear Delphi.

Also..
Code:
  writeLn('Your input as integer: '  + IntToStr( i ) + '.' + chr( 32 ) );
 

monoVertex

I'm back!
Reaction score
460
You know, he is asking about Pascal, not Object Pascal.

There is no such function as IntToStr in Pascal. I have no idea about this Object Pascal, though.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top