Results 1 to 4 of 4

Thread: Someone review my logic

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    62

    Someone review my logic

    I have a list of names, an example image, and a goal of having each list of names, be a copy of the example image, but renamed to use each name in the list.

    My idea is this:
    Create an array to take the image names (which are csv), and set a variable for the "example image" file. So when I want the example image to be hello.jpg, I set sampleimage = "c:\hello.jpg"

    Then the program will open that image, and save it using each number in the array. So if the array contained 5 wordd [hello1,how,are,you,today], the output will be 5 copies of the hello.jpg file, and would now be hello1.jpg, how.jpg, are.jpg, you.jpg, today.jpg.

  2. #2
    Fanatic Member
    Join Date
    May 2005
    Posts
    898

    Re: Someone review my logic

    Sure, you can use For Each to go through the array. And if the image is already a file on the disk you can use System.IO.File.Copy(origfilename, duplicatename)
    "so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    62

    Re: Someone review my logic

    Great, so basically for each in array,
    System.IO.File.Copy(origfilename, x)
    x =+1

    Or can I just have "Next" at the end of the loop?

  4. #4
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    Re: Someone review my logic

    Quote Originally Posted by Merlin2000
    Great, so basically for each in array,
    System.IO.File.Copy(origfilename, x)
    x =+1

    Or can I just have "Next" at the end of the loop?
    yes, for loops shift the variable for you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width