Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4106
Number of posts: 14016

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

Report
Runtime error Posted by NinthAngle on 27 Aug 2005 at 12:15 PM
Hi,
does anyone here know what might be the cause of a
"Runtime error 100 at 001d:05C7"

thx
NA
Report
Re: Runtime error Posted by zibadian on 27 Aug 2005 at 12:25 PM
: Hi,
: does anyone here know what might be the cause of a
: "Runtime error 100 at 001d:05C7"
:
: thx
: NA
:
According to the help files, that error is triggered when you read past the end of a file.
Report
Re: Runtime error Posted by NinthAngle on 27 Aug 2005 at 3:00 PM
: : Hi,
: : does anyone here know what might be the cause of a
: : "Runtime error 100 at 001d:05C7"
: :
: : thx
: : NA
: :
: According to the help files, that error is triggered when you read past the end of a file.
:

Any idea how I might go about fixing this?
Report
Re: Runtime error Posted by Phat Nat on 27 Aug 2005 at 5:09 PM
: : : Hi,
: : : does anyone here know what might be the cause of a
: : : "Runtime error 100 at 001d:05C7"
: : :
: : : thx
: : : NA
: : :
: : According to the help files, that error is triggered when you read past the end of a file.
: :
:
: Any idea how I might go about fixing this?
:

What caused the error? Are you reading a file or Loading a pic or a sound file, etc? Are you directly accessing memory (Mem[$xxxx:$xxxx] := xxxx;)? Any of these could cause the error and the location doesn't help us without the code.

Phat Nat

Report
Re: Runtime error Posted by NinthAngle on 28 Aug 2005 at 9:41 AM
: : : : Hi,
: : : : does anyone here know what might be the cause of a
: : : : "Runtime error 100 at 001d:05C7"
: : : :
: : : : thx
: : : : NA
: : : :
: : : According to the help files, that error is triggered when you read past the end of a file.
: : :
: :
: : Any idea how I might go about fixing this?
: :
:
: What caused the error? Are you reading a file or Loading a pic or a sound file, etc? Are you directly accessing memory (Mem[$xxxx:$xxxx] := xxxx;)? Any of these could cause the error and the location doesn't help us without the code.
:
: Phat Nat
:
:

Im loading piuctures using the unit posted in the 'Bmp Graphics Unit' thread. The program stops in the middle of the unit.

Report
Re: Runtime error Posted by NinthAngle on 28 Aug 2005 at 9:51 AM
: : : : Hi,
: : : : does anyone here know what might be the cause of a
: : : : "Runtime error 100 at 001d:05C7"
: : : :
: : : : thx
: : : : NA
: : : :
: : : According to the help files, that error is triggered when you read past the end of a file.
: : :
: :
: : Any idea how I might go about fixing this?
: :
:
: What caused the error? Are you reading a file or Loading a pic or a sound file, etc? Are you directly accessing memory (Mem[$xxxx:$xxxx] := xxxx;)? Any of these could cause the error and the location doesn't help us without the code.
:
: Phat Nat
:
:

To be more precise, the compiler stops at this line:
BlockRead(F, Info.BMPHeader, SizeOf(Info.BMPHeader));

Report
Re: Runtime error Posted by Phat Nat on 28 Aug 2005 at 12:28 PM
: : : : : Hi,
: : : : : does anyone here know what might be the cause of a
: : : : : "Runtime error 100 at 001d:05C7"
: : : : :
: : : : : thx
: : : : : NA
: : : : :
: : : : According to the help files, that error is triggered when you read past the end of a file.
: : : :
: : :
: : : Any idea how I might go about fixing this?
: : :
: :
: : What caused the error? Are you reading a file or Loading a pic or a sound file, etc? Are you directly accessing memory (Mem[$xxxx:$xxxx] := xxxx;)? Any of these could cause the error and the location doesn't help us without the code.
: :
: : Phat Nat
: :
: :
:
: 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

Report
Re: Runtime error Posted by NinthAngle on 29 Aug 2005 at 5:29 PM
: : : : : : Hi,
: : : : : : does anyone here know what might be the cause of a
: : : : : : "Runtime error 100 at 001d:05C7"
: : : : : :
: : : : : : thx
: : : : : : NA
: : : : : :
: : : : : According to the help files, that error is triggered when you read past the end of a file.
: : : : :
: : : :
: : : : Any idea how I might go about fixing this?
: : : :
: : :
: : : What caused the error? Are you reading a file or Loading a pic or a sound file, etc? Are you directly accessing memory (Mem[$xxxx:$xxxx] := xxxx;)? Any of these could cause the error and the location doesn't help us without the code.
: : :
: : : Phat Nat
: : :
: : :
: :
: : 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...





Report
Re: Runtime error Posted by Phat Nat on 29 Aug 2005 at 5:59 PM
: : :
: : : 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

Report
Re: Runtime error Posted by NinthAngle on 30 Aug 2005 at 9:23 AM
: : : :
: : : : 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.


--------------------------------------------------------------------------------


Report
Re: Runtime error Posted by Phat Nat on 30 Aug 2005 at 6:49 PM
This message was edited by Phat Nat at 2005-8-30 18:50:13

You are wreaking havoc on your program! Seriously though, your problem is that you are overwriting valuable information on your program, causing it to run erratically. I have erased alot of the code, leaving the important parts:

:
: 
: PROGRAM TestBMP;
: USES Crt,Show_BMP,Dos;
: VAR
:    Filename: Array[1..5] of String;
(** This is being declared as having only 5 string variables **)
:    Answer: Array[1..5] of Char;
:    mr, sr, hsr: Array[1..5] of Integer;
:    hb, mb, sb, hsb: Word;
:    h, m, s, hs: Word;: 
: 
: BEGIN
:   ClrScr;
:  For i:=1 to 32 Do
:  Begin
:   Filename[i]:=IntToStr(i);
(** This is being used as having 32 string variables **)
:  End;
: 
:  Repeat
:   Randomize;
:    i:=Random(32+1);
(** This is being used as having 32 string variables **)
: 
: 
:      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);
: END.
: 
: 


As you see, throughout the program you are using FILENAME as having up to 32 string variables, where it is declared as only having 5. So when you Use FILENAME[6], you are actually overwriting part of ANSWER. After FILENAME[26], you start writing over the program code & other important stuff, causing strange random crashes/errors. A Preferred way of writing the above for quick change & safety is like so:
CONST
   MaxFileNames = 32;
VAR
   Filename: Array[1..MaxFileNames] of String;
BEGIN
   ClrScr;
   For i:=1 to MaxFileNames Do
   Begin
      Filename[i]:=IntToStr(i);
   End;


This way, you can change all the code at once in a matter of a couple of seconds.

Phat Nat



Report
Re: Runtime error Posted by NinthAngle on 31 Aug 2005 at 3:13 PM
: This message was edited by Phat Nat at 2005-8-30 18:50:13

: You are wreaking havoc on your program! Seriously though, your problem is that you are overwriting valuable information on your program, causing it to run erratically. I have erased alot of the code, leaving the important parts:
:
: :
: : 
: : PROGRAM TestBMP;
: : USES Crt,Show_BMP,Dos;
: : VAR
: :    Filename: Array[1..5] of String;
: (** This is being declared as having only 5 string variables **)
: :    Answer: Array[1..5] of Char;
: :    mr, sr, hsr: Array[1..5] of Integer;
: :    hb, mb, sb, hsb: Word;
: :    h, m, s, hs: Word;: 
: : 
: : BEGIN
: :   ClrScr;
: :  For i:=1 to 32 Do
: :  Begin
: :   Filename[i]:=IntToStr(i);
: (** This is being used as having 32 string variables **)
: :  End;
: : 
: :  Repeat
: :   Randomize;
: :    i:=Random(32+1);
: (** This is being used as having 32 string variables **)
: : 
: : 
: :      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);
: : END.
: : 
: : 

:
: As you see, throughout the program you are using FILENAME as having up to 32 string variables, where it is declared as only having 5. So when you Use FILENAME[6], you are actually overwriting part of ANSWER. After FILENAME[26], you start writing over the program code & other important stuff, causing strange random crashes/errors. A Preferred way of writing the above for quick change & safety is like so:
:
: CONST
:    MaxFileNames = 32;
: VAR
:    Filename: Array[1..MaxFileNames] of String;
: BEGIN
:    ClrScr;
:    For i:=1 to MaxFileNames Do
:    Begin
:       Filename[i]:=IntToStr(i);
:    End;
: 

:
: This way, you can change all the code at once in a matter of a couple of seconds.
:
: Phat Nat
:
:
:
:

Thanks, I totally missed that with the Filename array of only 1..5 and it does correct the 'unable to display file' error! However, I dont see what you say about my program bein erratic. Surely, you understand that all the extra code ive tried to put in there is necessary for my progz bells and whistles[?]
I also dont understand why you gaze me exactly this section of code:
: :
: : 
: : PROGRAM TestBMP;
: : USES Crt,Show_BMP,Dos;
: : VAR
: :    Filename: Array[1..5] of String;
: (** This is being declared as having only 5 string variables **)
: :    Answer: Array[1..5] of Char;
: :    mr, sr, hsr: Array[1..5] of Integer;
: :    hb, mb, sb, hsb: Word;
: :    h, m, s, hs: Word;: 
: : 
: : BEGIN
: :   ClrScr;
: :  For i:=1 to 32 Do
: :  Begin
: :   Filename[i]:=IntToStr(i);
: (** This is being used as having 32 string variables **)
: :  End;
: : 
: :  Repeat
: :   Randomize;
: :    i:=Random(32+1);
: (** This is being used as having 32 string variables **)
: : 
: : 
: :      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);
: : END.
: : 
: : 


All parts are equally important...[?]



 

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.