Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #14036
| From | a.a.almasy@gmail.com |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Splice fails (Mathematica 9; Windows) |
| Date | 2013-04-03 08:07 +0000 |
| Message-ID | <kjgo0g$pub$1@smc.vnet.net> (permalink) |
| References | <kgutm5$nsl$1@smc.vnet.net> |
| Organization | Time-Warner Telecom |
I have a similar problem. I am trying to Splice a file but all Mathematica would do is delete the two delimiters <* and *>. The code is:
MyFortranForm[exp_, name_] := Module[{rules, file, out, frm, form},
rules = {};
file = name <> ".mf";
out = OpenWrite[file];
WriteString[out, name <> " = <* form *> "];
Close[out];
form =
StringJoin @@
Riffle[With[{splits =
StringSplit[ToString@FortranForm[exp //. rules], " "]},
Fold[If[StringLength[Last@#1] + StringLength[#2] > 60,
Join[#1, {#2}],
Join[Most[#1], {StringJoin[Last[#1], #2]}]] &, {First@
splits}, Rest[splits]]], " &\n"] ;
On[frm];
Splice[name <> ".mf", PageWidth -> 120];
FilePrint[name <> ".f"];
Return[]
];
Now when I am using this on an expression:
MyFortranForm[A+B+C, "test"]
it returns:
test = form
Does anyone has any ideas? I cannot find the problem. Internally form has the right form but it won't get sliced into the file.
Thanks,
Andrea
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Splice fails (Mathematica 9; Windows) Alan <alan.isaac@gmail.com> - 2013-03-03 07:21 +0000
Re: Splice fails (Mathematica 9; Windows) Alan <alan.isaac@gmail.com> - 2013-03-06 03:13 +0000
Re: Splice fails (Mathematica 9; Windows) a.a.almasy@gmail.com - 2013-04-03 08:07 +0000
Re: Splice fails (Mathematica 9; Windows) Roland Franzius <roland.franzius@uos.de> - 2013-04-05 02:30 +0000
csiph-web