• Support
  • Articles
  • Resources
  • Products

FileOpen command bug

Moderator: boris

3 postsPage 1 of 1

boris
Moderator, LogMeTT and TTLEditor developer

Posts:
1596
Joined: Sat Jan 08, 2005 2:52 pm
by boris » Mon Mar 13, 2017 11:42 pm
Hi,

I just discovered strange behavior of fileopen macro command which is in the 1st line in my macro script. The following line works fine:

Code: Select all

  1. fileopen fhandle 'C:\Temp\List.txt' 0

but the line below

Code: Select all

  1. fileopen fhandle 'C:\Temp\List.txt' 1

causes macro script not to run. No error message, nothing at all, like if I've never run the macro.

Tested on Windows 7 Professional by opening .TTL file from Control->Macro menu of Tera Term 4.94.
Thanks.
Best regards,
Boris
Yutaka Hirata
TeraTerm Developer

Posts:
606
Joined: Wed Jan 12, 2005 2:35 pm
by Yutaka Hirata » Tue Mar 14, 2017 11:39 am
Hi Boris,

Thank you for your feedback.
However, I can not reproduce your problem. I have tested your script
by using Tera Term 4.94 on Windows 7.

Thanks.
Best regards, Yutaka Hirata
(yutakakn at gmail.com)
http://hp.vector.co.jp/authors/VA013320/
boris
Moderator, LogMeTT and TTLEditor developer

Posts:
1596
Joined: Sat Jan 08, 2005 2:52 pm
by boris » Tue Mar 14, 2017 5:23 pm
Hi Yutaka,

I stripped down my script to the following and did few more tests

Code: Select all

  1. fileopen fhandle 'C:\TMP\IP_List.txt' 0
  2. while 1
  3.    ; Read a line containing the IP address from the file
  4.     filereadln fhandle ip_address
  5.     if result=1 then
  6.         break
  7.     endif
  8.     ;
  9.     ; My other code here
  10.     ;
  11. endwhile    
  12. fileclose fhandle

And I found the problem. When append flag is set to 1 the file pointer is moved to the end of the file and the result value in line 5 returns 1 and breaks the loop right away. So, the macro exits without doing anything and gives the impression that it never run. This means there is no bug here. Thanks for checking.
Thanks.
Best regards,
Boris
Display posts from previous:
Sort by:

3 postsPage 1 of 1

Users browsing this forum: Trevor