Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2005
    Location
    Flanders - Belgium
    Posts
    17

    Get systemdate into a filename

    Hello,
    (sorry for my bad English)
    I'm learning to use AMS 6.0 for some time and want to thank all you great guys; I've learned a lot from you all. Thanks!!
    But now I have a problem and I've not found any example on the Forum... looking for some days now...
    I need to copy the user files to an other place, and put the systemdate into the filename.
    My code:
    dag = System.GetDate(5);
    maand = System.GetDate(4);
    jaar = System.GetDate(6);

    datum = ("..dag.., ..maand.., ..jaar..");
    newname = ("datum".."Filename.txt");

    File.Copy ("C:\\PHAISTOS\\Filename.txt", "C:\\PHAISTOS\\BACKUP\\..newname");
    But I can't get it done... what do I wrong?

    What I would like to have as a result is:
    C:\\PHAISTOS\\BACKUP\\28-04-2007_Filename.txt

    Please can I get some help?

  2. #2
    Join Date
    May 2005
    Posts
    1,115
    newname = (datum.."_Filename.txt");
    Never know what life is gonna throw at you.
    (Based on a true story.)

  3. #3
    Join Date
    Nov 2005
    Location
    Flanders - Belgium
    Posts
    17

    Get systemdate into a filename

    Thanks Bule for quick responce... but it's not resulting in changing the filename "Filename.txt" into "07-08-2007_Filename.txt"
    Could you help me out a bit more?
    Thanks

  4. #4
    Join Date
    Jul 2007
    Location
    Quezon City, Philippines
    Posts
    46

    here you go man

    datum = dag.."-"..maand.."-"..jaar

  5. #5
    Join Date
    Nov 2005
    Location
    Flanders - Belgium
    Posts
    17

    Get systemdate into a filename

    Hello Macko,

    problem remains...
    File.Copy "C:\\PHAISTOS\\Filename.txt", "C:\\PHAISTOS\\BACKUP\\..newname");
    It results in "..newname" as a filename, instead of "07-08-2007_Filename.txt"

  6. #6
    Join Date
    Jul 2007
    Location
    Quezon City, Philippines
    Posts
    46

    oh i see it clearly now

    change
    File.Copy "C:\\PHAISTOS\\Filename.txt", "C:\\PHAISTOS\\BACKUP\\..newname");

    to this
    File.Copy "C:\\PHAISTOS\\Filename.txt", "C:\\PHAISTOS\\BACKUP\\"..newname);

    never include a variable in the " " since it will be read as is and not as a variable.

  7. #7
    Join Date
    Nov 2005
    Location
    Flanders - Belgium
    Posts
    17

    Yes !

    Thanks Macko,
    It works fine now.
    And I have learned again.

  8. #8
    Join Date
    Jul 2007
    Location
    Quezon City, Philippines
    Posts
    46

    no prob

    i did learned that to the experts of ams and share it to others

Similar Threads

  1. Function: Get Filename from URL
    By Brett in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 05-31-2004, 02:46 PM
  2. Problems in HTTP.
    By kazzz in forum Setup Factory 6.0
    Replies: 2
    Last Post: 02-24-2004, 01:09 PM
  3. Need Help on how to gather part of a filename
    By Martin_SBT in forum AutoPlay Media Studio 4.0
    Replies: 7
    Last Post: 07-30-2003, 05:09 PM

Posting Permissions

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