semlemsushi Posted October 27, 2011 Author Share Posted October 27, 2011 I'm looking for a program that will rename my sprites. The images in the folder are 1-600\. All I need to do to the names are add +72 to them. So basically, 1 would change to 73, 2 would change to 74, 3 would change to 75, and so on. Is there a program that can do this? Or a tutorial perhaps? Thanks guys! Link to comment Share on other sites More sharing options...
iSKweek Posted October 27, 2011 Share Posted October 27, 2011 Something like this would work.``` Dim file As String Dim newfile As String Dim i, j As Long For i = 1 To 600 file = "insert filepath here" & i & ".bmp/.png" Picture1.Picture = LoadPicture(file) j = i + 72 newfile = "insert filepath here" & j & ".bmp/.png" SavePicture Picture1, newfile Picture1.Picture = Nothing Kill file Next``` Link to comment Share on other sites More sharing options...
Robin Posted October 27, 2011 Share Posted October 27, 2011 Why in God's name would you re-save the image instead of just renaming the file? That is the most retarded code I have ever seen. Link to comment Share on other sites More sharing options...
iSKweek Posted October 27, 2011 Share Posted October 27, 2011 I was just writing from memory. I have never done something like this before. Link to comment Share on other sites More sharing options...
Robin Posted October 27, 2011 Share Posted October 27, 2011 This has absolutely nothing to do with memory. This is basic theory. If you want to rename a file do you use Window's rename function or do you open it in Paint and re-save it under a different name then delete the old file? Link to comment Share on other sites More sharing options...
iSKweek Posted October 27, 2011 Share Posted October 27, 2011 I meant from memory as in I didn't know of a way to do it like that. But after some just looking it up on google I came up with this:```Dim file, newfile As StringDim i As LongFor i = 1 To 600 file = "filename" & i & ".bmp" newfile = "filename" & (i + 72) & ".bmp" Name file As newfileNext```Better? Link to comment Share on other sites More sharing options...
semlemsushi Posted October 28, 2011 Author Share Posted October 28, 2011 So the code you just posted, am I supposed to put that under a button click event? Or in the form load event? Just need to classify, thanks! Link to comment Share on other sites More sharing options...
iSKweek Posted October 28, 2011 Share Posted October 28, 2011 If you just make a new project and chuck it in the form load sub you should be right. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now