Hello,
If I have written a script that does something like this:
script start
go
pickup reactants minerals
save minerals.rea
#do some other stuff
#recall the minerals you saved earlier
read minerals.rea
GWB throws up an error about not being able to locate the database file. The problem is that the beginning of every saved .rea has the line
data = "C:\Program Files\Gwb\Gtdata\thermo.dat" verify
But of course those slashes really need to be escaped like:
data = "C:\\Program Files\\Gwb\Gtdata\\thermo.dat" verify
with the result that the wrong file string is sent to GWB.
Is there a simple way around this?
I have worked around it by using the following code to delete the first two lines of the file like so:
set source [open "fluid0$cellCurrent\.rea" r]
set outFluid [open "fluid0$cellCurrent\_deleted.rea" w]
gets $source aline
gets $source aline
while {$aline!=""} {
gets $source aline
puts $outFluid $aline
}
close $source
close $outFluid
By the way, this problem threw up a secondary issue where the "read" tcl command conflicts with the "read" GWB command. So I've had to use "gets" to work around that issue. The above code is very inflexible and clumsy because I can't read the whole file into tcl. Is there a way to specify that a command is for tcl and not for GWB?
So to recap, two issues, is there a way to save parts of the system to a file without the preamble database file string? It would be great to be able to save just the minerals or just the fluid, for example. And is there a way to solve the conflict of the "read" command?