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

Username:   Password: 
 RegisterRegister   
 Problem with combining strings and then using it in Pic.Draw
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Krivoshein




PostPosted: Sat Apr 07, 2012 4:44 pm   Post subject: Problem with combining strings and then using it in Pic.Draw

What is it you are trying to achieve?
I created an animation in Blender, and exported each frame into .jpg. Now, I need to call the .jpg together - but I didn't want to manually call out 65 .jpgs so I made an intstr to turn each i in the array to a string. (I also renamed all the jpg into '1.jpg', '2.jpg'... '65.jpg'). Is there a way for me to do that? I know I can do a Sys.Exec but it won't work on a school computer.


What is the problem you are having?
It says that picName argument is the wrong type. Can I do anything to solve it?

Describe what you have tried to solve this problem
I tried changing where I declared picName but it didn't really help, tried searching the forums but couldn't find anything and now I'm asking here.


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)

Turing:



var titlePics : array 1..65 of int
var picName : string

%irrelevant code here

for i : 1 .. 65
            picName := intstr (i) + ".jpg"
            put picName
                titlePics (i) := Pic.Draw (picName, 0, 0, maxx, maxy)
        end for




Please specify what version of Turing you are using
I'm using 4.1.1
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Sat Apr 07, 2012 5:04 pm   Post subject: RE:Problem with combining strings and then using it in Pic.Draw

You probably want to do a Pic.FileNew to actually load your image before you draw it.
Krivoshein




PostPosted: Sat Apr 07, 2012 5:40 pm   Post subject: Re: Problem with combining strings and then using it in Pic.Draw

I added Pic.FileNew but I still have the same problem. (I added titlePics (i) := Pic.FileNew (picName) the line before Pic.Draw).
Krivoshein




PostPosted: Sat Apr 07, 2012 5:52 pm   Post subject: Re: Problem with combining strings and then using it in Pic.Draw

Nevermind, I messed up my syntax. I changed it to:

for i : 1 .. 65
%Concatenate strings
picName := intstr (i) + ".jpg"
put picName
finalPic := Pic.FileNew (picName)
Pic.Draw (finalPic, 1, 1, picCopy)
end for

But it now says illegal picture ID, but I'll just play around with Turing until I get it. Thanks.
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  [ 4 Posts ]
Jump to:   


Style:  
Search: