Hi,
All i want to do is insert a carriage return to seperate 2 lines in a log file i’m creating. I’ve tried typing cr in every place without success and i can’t find any example code in the SenseTalk reference. Can someone help me? The code i’m using is below.
global VFSSResults
put “~/Documents/VFSSResults.txt” into VFSSResults
open file VFSSResults for readwrite
write “Test cases 4810, 4812, 4815, 4829, 4791, 4794, 4768, 4774, 4778, 4765 have passed. I Want the carriage return in here. Something else written on the next line” to file “~/Documents/VFSSResults.txt”
close file VFSSResults
Hi:
One pitfall when writing out to a file is that whatever appears between the quotes will get written out with no interpretation. So if you were sending text to the system under test, you could do this:
TypeText "This text would be on one line.\rAnd this would be on another line."
But if you were to write the above out to a file, you’d get two sentences on one line with a “\r” in the middle. To write your example out to a file and includ the carriage return, you’ll need to do this:
write "Test cases 4810, 4812, 4815, 4829, 4791, 4794, 4768, 4774, 4778, 4765 have passed." & return & "Something else written on the next line" to file "~/Documents/VFSSResults.txt"
In concatenating the strings together, Eggplant/SenseTalk will interpret the “return” and replace with a carriage return before the string is written to the file.
Thanks Matt, worked like a treat