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
Re: BMP Graphics Unit Posted by zibadian on 19 Aug 2005 at 9:17 PM
: Say for instance I would want the program to randomly load 1 of 5 pictures. How would I have to change the code? Ive been boggling over this one and simply cant come up with an answer because I dont know how to make the Integer based randomize command agree with something like a file in a directory.
:
Here is a simple example:
  i := Round(Random*6+1); { Create a random number from 1 to 5 }
  Filename := Format('%.3d.bmp', [i]); { Create a filename with 3 digits }

These two lines will give you filenames like "001.bmp", "002.bmp", etc.
Thread Tree
Phat Nat BMP Graphics Unit on 17 Aug 2005 at 11:55 PM
NinthAngle Re: BMP Graphics Unit on 18 Aug 2005 at 11:33 AM
zibadian Re: BMP Graphics Unit on 18 Aug 2005 at 1:38 PM
NinthAngle Re: BMP Graphics Unit on 18 Aug 2005 at 3:44 PM
NinthAngle Re: BMP Graphics Unit on 18 Aug 2005 at 4:54 PM
Phat Nat Re: BMP Graphics Unit on 18 Aug 2005 at 5:00 PM
NinthAngle Re: BMP Graphics Unit on 19 Aug 2005 at 2:55 PM
zibadian Re: BMP Graphics Unit on 19 Aug 2005 at 9:17 PM
NinthAngle Re: BMP Graphics Unit on 26 Aug 2005 at 11:17 AM
anoneds Re: BMP Graphics Unit on 20 Aug 2005 at 5:42 AM
gadda Re: BMP Graphics Unit on 25 Aug 2005 at 8:13 AM
zibadian Re: BMP Graphics Unit on 25 Aug 2005 at 10:10 AM
gadda Re: BMP Graphics Unit on 25 Aug 2005 at 8:04 PM
NinthAngle Re: BMP Graphics Unit on 26 Aug 2005 at 11:15 AM
Phat Nat Re: BMP Graphics Unit on 27 Aug 2005 at 5:01 PM
NinthAngle Re: BMP Graphics Unit on 26 Aug 2005 at 1:53 PM
anoneds Re: BMP Graphics Unit on 26 Aug 2005 at 5:06 PM
NinthAngle Re: BMP Graphics Unit on 27 Aug 2005 at 7:43 AM
Phat Nat Re: BMP Graphics Unit on 27 Aug 2005 at 4:56 PM
NinthAngle Re: BMP Graphics Unit on 27 Aug 2005 at 9:17 AM
Phat Nat Re: BMP Graphics Unit on 27 Aug 2005 at 5:03 PM



 

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.