Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

"FileRead" dosen't seem to be work with some text files


  • Please log in to reply
2 replies to this topic
csankok
  • Members
  • 2 posts
  • Last active: Feb 20 2014 04:29 PM
  • Joined: 17 Feb 2014

Hy to all!
 
I'm working on a program that creates text files with different content, mostly simple numerical data, and I 
have a problem with the code, maybe it's simple but I can't figured it out. Here is the script:
 
Randomgen:
Loop, %vari%
{
GuiControl, +Range0-%vari%, progressbar,
{
SB_SetText( "Creating input files: " A_Index " / " vari, 1)
GuiControl, , progressbar, +1
}
SetFormat, float, 05.0
name += 1.0 
namelong = %name%_%namesort%
FileAppend, %extract%`n, %inputfolder%\%namelong%.gjf
FileAppend, %dihedset%`n, %inputfolder%\dihedset.txt
Loop, %dihed%
{
FileReadLine, dihedmod, %inputfolder%\dihedset.txt, %A_Index%
rand := 0
SetFormat, float, 0.6
Random, rand, %min%, %Max%
dihedsetact:=TF_ColPut(dihedmod, 1, 1, 50," ", 0)
dihedsetact1:=TF_ColpUt(dihedsetact, 1, 1, 50, rand, 0)
dihedsetact2:=TF_ColPut(dihedsetact1, 1, 1, 50, " F", 0)
Fileappend, %dihedsetact2%`n, %inputfolder%\dihedsetact.txt
}
FileRead, dihedangle, %inputfolder%\dihedsetact.txt, 
FileAppend, %dihedangle%`n, %inputfolder%\%namelong%.gjf
FileDelete, %inputfolder%\dihedset.txt
FileDelete, %inputfolder%\dihedsetact.txt
}

 

the problem is: the last "FileRead" command what marked with red in the script, doesen't seem to be work...
the text file "dihedsetact.txt" does exist in every cicle, so I'm confused why it's not work properly?

I greatly appreciate every help!

Krisztian



faqbot
  • Members
  • 997 posts
  • Last active:
  • Joined: 10 Apr 2012
Remove the , after %inputfolder%\dihedsetact.txt ?

csankok
  • Members
  • 2 posts
  • Last active: Feb 20 2014 04:29 PM
  • Joined: 17 Feb 2014

Remove the , after %inputfolder%\dihedsetact.txt ?

Thanks for the advice!

I was declared once the variable with a different name and it solv the problem:
 

}
dihedfinal = %inputfolder%\dihedsetact.txt
FileRead, dihedangle, %dihedfinal%
blank = 
FileAppend, %blank%`n, %inputfolder%\%namelong%.gjf
FileAppend, %dihedangle%`n, %inputfolder%\%namelong%.gjf
FileDelete, %inputfolder%\dihedset.txt
FileDelete, %inputfolder%\dihedsetact.txt
}
 
Thanks for the help!