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.

DarkBASIC Discussion / about strings

Author
Message
freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 20th Jan 2003 20:01
Hi

I want to load 52 bitmaps for a playing card game. They are named 1.bmp, 2.bmp, 3.bmp, etc...
I'd like to do this using a for/next loop.
My question is: How can I place an integer and a string in one string?

It should be something like this, but it doesn't work:

for t=1 to 52
filename$=t,".bmp"
load image filename$,t
next t
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 20th Jan 2003 20:07
for t=1 to 52
filename$ = str$(t) + ".bmp"
load image filename$,t
next t

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 21st Jan 2003 01:16
thanks, it works!

I'm glad I didn't have to type all 52 lines

Login to post a reply

Server time is: 2025-05-11 07:42:14
Your offset time is: 2025-05-11 07:42:14