Readfile in Temp_Dir

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Readfile in Temp_Dir

Post by kpassaur » Wed Jan 27, 2010 3:32 pm

This makes no sense to me

I create a text file in the %TEMP_DIR% and I can execute it and it contains text, however if I read it, there is nothing there.

ExecuteFile>%TEMP_DIR%test.txt
ReadFile>%TEMP_DIR%test.txt,testtext

In the debugger it comes back as TESTTEXT=


Now if I take this same file, move it to C:\test.txt and read it the variable testtext is read

Any ideas?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Jan 27, 2010 4:33 pm

The same code works for me (with test.txt in my temp folder).

Maybe we need to see the rest of your code.

Or maybe something else is writing to test.txt in your temp folder, preventing the ReadFile from working.

What happens with a ReadLn - what is returned?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Jan 27, 2010 4:36 pm

Or perhaps the Watchlist is not properly displaying the text file. Do you see any results if you display the result variable in a modal message?

MDL>TESTTEXT

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Jan 27, 2010 4:36 pm

Or make the watchlist wider ....
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Watch list wider

Post by kpassaur » Wed Jan 27, 2010 5:07 pm

Marcus,

You hit the nail on the head. It was there not blank. Before it was not finding the file (I fixed that) and then it showed as blank and I thought nothing was there which did not make sense.

So I moved the file and showed it in a message box, I did not try in a message box from the origional as I saw nothing in the watch list.

Thanks

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts