Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / loading multiple files

Author
Message
Zer0
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Canada
Posted: 4th May 2006 08:36
Hey, Long time no post eh? anywho, I would like to know if its possible to load multiple files (image maps) using for and next (I dont mean "get image blah") I mean actully loading files with load image, i have tryed it myself, but right now I can't seem to get past the filename problem (the files are named tileset0000 to 0100) so instead of having 100 loadimage commands I'm trying to use for and next to make things easyer on me later, but no matter what I do i can't see to get the filename to change since the numbers are in the middel and its a string (tileset0000.jpg).

Any ideas would be awesome.
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 4th May 2006 09:59 Edited at: 4th May 2006 11:13
This will work.....


For n = 1 to 100
Number$=Str$(n)
Title$ = "Tileset0" + number$ + ".jpg"
Load Image Title$,n
Next n

Edit: Actually that will not work, not enough zeros. Hold on....

For n = 1 to 100
if n = 100 then zeros$ = "0"
if n < 100 then zeros$ = "00"
if n < 10 then Zeros$ = "000"
Number$=Str$(n)
Title$ = "Tileset" + Zeros$ + number$ + ".jpg"
Load Image Title$,n
Next n

If you make something like this, test it like this...........

Set text opaque

For n = 1 to 100
if n = 100 then zeros$ = "0"
if n < 100 then zeros$ = "00"
if n < 10 then Zeros$ = "000"
Number$=Str$(n)
Title$ = "Tileset" + Zeros$ + number$ + ".jpg"
text 0,0,title$
wait 500
Next n

Zer0
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Canada
Posted: 5th May 2006 02:06
That did the trick thanks man.

Login to post a reply

Server time is: 2024-09-24 21:38:03
Your offset time is: 2024-09-24 21:38:03