The Daily Click ::. Forums ::. Klik Coding Help ::. Moving created MS-DOS file with TGF File Object
 

Post Reply  Post Oekaki 
 

Posted By Message

djDarkX



Registered
  19/04/2005
Points
  8
26th January, 2006 at 15:21:15 -

Hello Forum Users,

I'm new to the forums, but not to kliking. Okay, I have a small, yet very annoying, problem. I am coding a frontend app with TGF Pro and using the File Object to call upon the said MS-DOS program the frontend is being built for. Now, I have gotten it to successfully run the program with user-typed parameters within Edit Box's. Here's the code for the File Object once the user enters the correct info and presses the "Encode!" button:

Button ENCODE clicked + SOURCEDIR has just been modified + TARGETDIR has just been modified -
Run application: "adxencd.exe" "(wait)" + Edittext$( "SOURCEDIR" ) + Edittext$( "FILENAME" ) + ".wav"

Now, this encodes a WAV file over to an ADX file using an MS-DOS program. My problem is that once the file is created, I want the file to be moved to a directory of the users choice. I placed this code right after the above code:

Move file: Edittext$( "SOURCEDIR" ) + Edittext$( "FILENAME" ) + ".adx" to Edittext$( "TARGETDIR" )

Now, I'm sure this will work, but the fact is that everytime I do that, it doesn't move the file because it's trying to move a file that hasn't been created yet. The "(wait)" command doesn't work or else I wouldn't be asking this question. How do I get the file to be moved only after teh file has been created? Please help me. Thank you!

Jesse~

 
Master Of The Prepaid Sidekick 2!

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
26th January, 2006 at 16:51:45 -

I'm not very familiar with the File object, but from a quick look, you could use the "Name exists" event to check continually if a file exists (with possibly an additional flag to stop the event if you're not expecting the file to be there yet), and have the Move action performed when it does. That relies on the file being created and written to all in one action, though.

 
http://www.davidn.co.nr - Games, music, living in America

djDarkX



Registered
  19/04/2005
Points
  8
26th January, 2006 at 17:45:30 -

Well, I actually tried that after my initial post and it didn't work. It seems that placing this:

[Every 00"-01] + [Name Exists: apppath$ + Edittext$( "FILENAME" ) + ".adx"]
Move File: [apppath$ + Edittext$( "FILENAME" ) + ".adx"] to [Edittext$( "TARGETDIR" )]

Doesn't do anything. The file is still in the App's path. Anyone else used Object File before and gotten good results?

Jesse~

EDIT:
I got it to work...somewhat.
I got the desired effect by asking the MS-DOS program to create the file in a different directory instead of trying to move it. Here is the code:

Name of application to run:
"adxencd.exe"
Enter "(hide,wait)" then command line:
Edittext$( "SOURCEDIR" ) + Edittext$( "FILENAME" ) + ".wav" + " " + Edittext$( "TARGETDIR" ) + Edittext$( "FILENAME" ) + ".adx"

Thanks admin for helping me out.

Image Edited by the Author.

Image Edited by the Author.

Image Edited by the Author.

 
Master Of The Prepaid Sidekick 2!
   

Post Reply



 



Advertisement

Worth A Click