Martyn Amos
2005-08-10 11:45:30 UTC
Folks,
I have got the CLI version of Breve working under XP and Cygwin. I am trying
to capture the output of the simulation to a file, so that I can automate the
(many) test runs that I need to carry out. However, the output of a straight
print doesn't seem to be captured if I redirect the output to a file. So, I
have tried to dump the locations and sizes of various objects to a file (see
below). However, when Breve gets to this routine it complains about not being
able to convert vectors to strings.
I would very much appreciate your advice on what (if anything) I'm doing wrong
here.
Many thanks in advance,
Martyn
# This is a menu item that prints the locations of objects to stdout
+ to export-locations:
thing (object).
it (object).
it = new File.
it open-for-writing with-file ("output.txt").
foreach thing in (all Items):
{
if (thing get-owner) != 1:
{
it write-line text ((thing get-location)).
it write-line text ((thing get-size)).
}
}
it close.
---
Dr Martyn Amos
Lecturer in Computer Science
School of Engineering, Computer Science and Mathematics
University of Exeter, United Kingdom
Email: M.R.Amos*at*exeter.ac.uk
WWW: http://www.dcs.ex.ac.uk/~mramos
I have got the CLI version of Breve working under XP and Cygwin. I am trying
to capture the output of the simulation to a file, so that I can automate the
(many) test runs that I need to carry out. However, the output of a straight
print doesn't seem to be captured if I redirect the output to a file. So, I
have tried to dump the locations and sizes of various objects to a file (see
below). However, when Breve gets to this routine it complains about not being
able to convert vectors to strings.
I would very much appreciate your advice on what (if anything) I'm doing wrong
here.
Many thanks in advance,
Martyn
# This is a menu item that prints the locations of objects to stdout
+ to export-locations:
thing (object).
it (object).
it = new File.
it open-for-writing with-file ("output.txt").
foreach thing in (all Items):
{
if (thing get-owner) != 1:
{
it write-line text ((thing get-location)).
it write-line text ((thing get-size)).
}
}
it close.
---
Dr Martyn Amos
Lecturer in Computer Science
School of Engineering, Computer Science and Mathematics
University of Exeter, United Kingdom
Email: M.R.Amos*at*exeter.ac.uk
WWW: http://www.dcs.ex.ac.uk/~mramos