<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Stephan,<br>
I am not aware of any such components. If you are planning to put
your component into an external DLL (ie not into the TRNDll.dll)
then you will need to look at using something like the following:<br>
<br>
<pre>Integer lu,returnVal</pre>
<pre wrap="">lu = PAR(1) !read the parameter that is the file's logical unit number.
filename = getLUFilename(lu) !use an access function to figure out what the associated file name is
returnVal = closeFileIVF(lu) !use an access function that forces the TRNSYS kernel to close the file. NOTE: returnVal is meaningless; it is just the result of the function call.
Open (unit=NNN,file=filename,status='UNKNOWN',err=402) !now reopen it using your own logical unit number (denoted NNN). You can reuse lu if you want.
Rewind(NNN) !make sure you are at the beginning of the file.
Read(NNN,...) !now use standard FORTRAN Read, and If statements to find what you are looking for in the file
Backspace(NNN) !back up one line once you found what you were looking for.
Write(NNN,...) ! once you have found what you are looking for and backed up one line, use a Write statement to replace it
Close(NNN)
Best,
David
</pre>
<br>
<br>
On 10/11/2011 04:33, STEPHAN Louis 231500 wrote:
<blockquote
cite="mid:24CC2D8B1290F943BBD4FE84040BB7DCE3ABD2@EXDAG0-A2.intra.cea.fr"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">Hi everyone,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am writing to ask if someone did make a
type in TRNSYS that enable us to open a user defined text
file, search for a user define value and replace it with
another value.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Many Thanks!!<o:p></o:p></p>
<p class="MsoNormal">Louis,<o:p></o:p></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
TRNSYS-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:TRNSYS-users@cae.wisc.edu">TRNSYS-users@cae.wisc.edu</a>
<a class="moz-txt-link-freetext" href="https://mailman.cae.wisc.edu/listinfo/trnsys-users">https://mailman.cae.wisc.edu/listinfo/trnsys-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
***************************
David BRADLEY
Principal
Thermal Energy Systems Specialists, LLC
22 North Carroll Street - suite 370
Madison, WI 53703 USA
P:+1.608.274.2577
F:+1.608.278.1475
<a class="moz-txt-link-abbreviated" href="mailto:d.bradley@tess-inc.com">d.bradley@tess-inc.com</a>
<a class="moz-txt-link-freetext" href="http://www.tess-inc.com">http://www.tess-inc.com</a>
<a class="moz-txt-link-freetext" href="http://www.trnsys.com">http://www.trnsys.com</a></pre>
</body>
</html>