: : : :
: : : : To be more precise, the compiler stops at this line:
: : : : BlockRead(F, Info.BMPHeader, SizeOf(Info.BMPHeader));
: : : :
: : : :
: : :
: : : It sounds like you are loading a file that is not a BMP. Possibly it is a corrupted file or a file with size 0.
: : :
: : : Phat Nat
: : :
: : :
: :
: :
: : I wouldnt see how that might be the case simply because
: : a) The program randomly (it seems) works and doesnt work. Sometimes it will run and at other times it wont run.
: : Whats even stranger, is that now the program ALWAYS runs but sometimes refuses to load pictures. Ive tried using different images, all of the saved with the same tool, but still the programs sometimes will and sometimes wont run.
: : Could this be the same error?
: :
: : Another thing that baffles me, is that whenever I start the program from the compiler, it doesn load ANY pictures, wheras if I start from an EXE file it seems to work to the degree described above...
: :
:
: Hmm.. Sounds like my code may have an error. Although I'm sure that's not possible ;)
: Post the code you've written and let me see if I can dupicate it on my end. If so, I should be able to track down the error, *hopefully*.
:
: Phat Nat
:
:
PROGRAM TestBMP;
USES Crt,Show_BMP,Dos;
VAR
ClearColor : ColorType;
Loaded : Boolean;
i, runs: Integer;
Filename: Array[1..5] of String;
Answer: Array[1..5] of Char;
mr, sr, hsr: Array[1..5] of Integer;
hb, mb, sb, hsb: Word;
h, m, s, hs: Word;
function IntToStr(I: Longint): String;
{ Convert any integer type to a string }
var
S: string[11];
begin
Str(I, S);
IntToStr := S;
end;
BEGIN
ClrScr;
For i:=1 to 32 Do
Begin
Filename[i]:=IntToStr(i);
End;
Repeat
Randomize;
i:=Random(32+1);
Graphix($13);
{ $13 = 320x200 8-bit (256 Color) Mode }
ClearColor.Index := -1;
{ No Clear Color. Set this between 0 & 255 to make a see-through color }
Loaded := ShowBMP(0,0, Filename[i] + '.BMP',True,ClearColor,VGA);
{ Loaded := ShowBMP(0,0, Filename[i] ,True,ClearColor,VGA); }
{ Returns True if BMP Loaded, False otherwise.
First # is the starting Left position. _/ Used to move a smaller
Second # is the starting Top position. \ BMP to middle of screen.
Bitmap Name & Directory (NO long dir/filenames!)
True/False = Used for loading the BMP Palette or not.
ClearColor = of COLORTYPE. Index is used to display clear color.
OUTPUT. In this case to VGA screen. Useful for sending to a Virtual Screen
}
If NOT(Loaded) Then { If it didn't manage to load the BMP...}
Begin
DirectVideo := False;
{ Allow Writeln to write to the VGA screen }
WriteLn('Failed to Load BMP!');
End;
GetTime(hb, mb, sb, hsb);
repeat
GotoXY(1, 1);
GetTime(h, m, s, hs);
write(m, s, hs);
until Keypressed;
ReadKey;
SetTextMode;
{ Close down graphics and return to text mode }
Writeln(m-mb, ':', s-sb, ':', hs-hsb); {Work out how long it took}
Write('Letter: ');
runs:=runs+1;
Readln(Answer[runs]); {Store Data}
mr[runs] := m-mb; {Store Answer}
sr[runs] := s-sb;
hsr[runs]:= hs-hsb;
Until runs=5;
ClrScr;
For i := 1 to 5 Do
Begin
Writeln(Answer[i],' ', mr[i],':',sr[i],':', hsr[i]); {Spit Answers} {Spit Time}
End;
Readln;
END.
--------------------------------------------------------------------------------