


{"id":286833,"date":"2023-06-02T09:19:07","date_gmt":"2023-06-02T09:19:07","guid":{"rendered":"\/forum\/forums\/reply\/286833\/"},"modified":"2023-06-02T09:19:07","modified_gmt":"2023-06-02T09:19:07","slug":"286833","status":"publish","type":"reply","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/286833\/","title":{"rendered":"Reply To: How to write an array to text file ?"},"content":{"rendered":"<p>&lt;p&gt;Concerning the question about getting the maximum value, if I understand correctly, the problem is that everytime you go through the loop, you overwrite my_energy.&nbsp; I would simply use an additional storage variable like max_my_energy and initialise it to 0 before the loop begins, then in every step you should simply compare my_energy with the maximum until there, and if higher, substitute it.&nbsp;&nbsp;&lt;\/p&gt;&lt;p&gt;*IF,my_energy,GT,max_my_energy,THEN&lt;\/p&gt;&lt;p&gt;max_my_energy=my_energy&lt;\/p&gt;&lt;p&gt;*ENDIF&lt;\/p&gt;<\/p>\n","protected":false},"template":"","class_list":["post-286833","reply","type-reply","status-publish","hentry"],"aioseo_notices":[],"acf":[],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/replies\/286833","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/replies"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/reply"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/replies\/286833\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=286833"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}