Retrogamecoding(.org) > Other Languages

Pascal

(1/8) > >>

Tomaaz:
Is it difficult for someone who knows BASIC, Lua and JavaScript to start with Pascal? How different is it? I think I learned it in the past but have forgotten everything totally. :) I'd like to try EGSL engine with Pascal.

cvirus:
I don't think that is hard to move to pascal, see a simple record witch is very used in games.
But cybermonkey is the best person to answer that.



--- Code: ---program Cars;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes
{ you can add units after this };
type
TCar = record
ModelName: string;
Engine: Single;
ModelYear: Integer;
end;
var
Car: TCar;
begin
Write('Input car Model Name: ');
Readln(Car.ModelName);
Write('Input car Engine size: ');
Readln(Car.Engine);
Write('Input car Model year: ');
Readln(Car.ModelYear);
Writeln;
Writeln('Car information: ');
Writeln('Model Name : ', Car.ModelName);
Writeln('Engine size : ', Car.Engine);
Writeln('Model Year : ', Car.ModelYear);
Write('Press enter key to close..');
Readln;
end.
--- End code ---

Cybermonkey:
If you know BASIC, Pascal is rather easy to learn. I learned Turbo Pascal in School but did not code for years. Then I did some programming in yabasic. After that I re-discovered Pascal. This time it was Freepascal. The only thing one has to take care of is the type safety of Pascal. All variables have to be declared before they are used the first time. See here: http://wiki.freepascal.org/Variables_and_Data_Types
BTW, if you want to use the egslengine with FPC I recommend not to use Lazarus. All pure Pascal programming is done with Geany by me.

Tomaaz:
Declaring variables shouldn't be a problem. I did some coding in C, but, of course, I wouldn't call myself a C programmer. ;) I wasn't even thinking about Lazarus. The compiler is all I want to use. I will try and if I like it you can expect questions about Pascal and EGSL engine soon. ;)

Thanx!  :)

Tomaaz:
Forget it. I don't like Pascal. I could even stand annoying begin...end blocks (curly brackets are much better solution) but := instead of = is too much for me. :)

Navigation

[0] Message Index

[#] Next page

Go to full version