Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4095
Number of posts: 14004

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Trying to figure out what went wrong Posted by Xzentu on 16 Feb 2012 at 5:50 AM
hello fellow pascal programmers.
I come to ask you about your coding knowledge.
currently working on a program in pascal.
Got a chunk of code done, then compiled it. Didn't work properly unfortunately.
Narrowed down the problem to this unit:
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, jpeg, ExtCtrls;

type
TForm1 = class(TForm)
Panel1: TPanel;
Timer1: TTimer;
Image1: TImage;
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}
Var
i : Integer = 1 ;

procedure TForm1.Timer1Timer(Sender: TObject);
Var
Bitmap: TBitmap;
begin
Bitmap := TBitmap.Create;
Bitmap.LoadFromFile
('pictures\Pic'+IntToStr(i)+'.bmp');
Image1.Picture.Bitmap := Bitmap;
Image1.Stretch := True;
Bitmap.Free;
i:=i+1;
If i = 3
Then i := 1;

end;

end.
I have image files with the associated names, as well as a form that has all the relevant items.
Any obvious errors you can spot?




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.