Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 help with picture filename (combining words) (nevermind)
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
who cares?




PostPosted: Wed Oct 13, 2004 5:12 pm   Post subject: help with picture filename (combining words) (nevermind)

ok, i got a problem...

i have 10 pictures in a folder... each one named planet1, planet2, planet3, planet4, etc... up to 10

and i have a loop with a counter variable..

what i want to do is to be able to display each image every time the loop runs, so, first i display planet1, then planet2, then planet3, etc.

this is what i have made:

code:

loop
counter := counter + 1
counter_s := intstr (counter)
var planetPic : int := Pic.FileNew ("planet" + counter_s + ".jpg")
Pic.Draw (planetPic, 270, 200, picCopy)
exit when counter = 10
end loop


i get an error, cause it can't read the planet file name... can anyone help me please?

counter has alredy been initialized outside the loop for value 0 and counter_s, as you can see is a string...

thanks for the help! Smile
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Wed Oct 13, 2004 5:16 pm   Post subject: (No subject)

Since you know the range of numbers you're looping over, you'd be better off writing this as a for loop.

code:
for counter : 1 .. 10
who cares?




PostPosted: Wed Oct 13, 2004 5:17 pm   Post subject: (No subject)

wtd wrote:
Since you know the range of numbers you're looping over, you'd be better off writing this as a for loop.

code:
for counter : 1 .. 10


yeah, sure... i could do that... thanks

but i still have the problem with the file name... and i dont know why...

cause i did it last year with another file, i concatinated (is that how you spell it?) 2 numbers with an underscore and it worked...

anyone know what's wrong?
who cares?




PostPosted: Wed Oct 13, 2004 5:20 pm   Post subject: (No subject)

NEVERMIND!

i'm a moron....

i forgot to add the subfolder to the path.. Embarassed

delete this stupid thread please... Embarassed
fmy




PostPosted: Wed Oct 13, 2004 6:41 pm   Post subject: (No subject)

hahahahaha, i was just about to mention that.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: