<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[QUIK -> DDE &mdash; формат файлов в каталоге archive]]></title>
		<link>https://quik2dde.ru/viewtopic.php?id=308</link>
		<atom:link href="https://quik2dde.ru/extern.php?action=feed&amp;tid=308&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «формат файлов в каталоге archive».]]></description>
		<lastBuildDate>Tue, 10 Dec 2019 09:18:35 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: формат файлов в каталоге archive]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=2537#p2537</link>
			<description><![CDATA[<p>можно грузить эти файлы в lua при помощи [url=http://www.inf.puc-rio.br/~roberto/struct/]lua struct[/url]</p>]]></description>
			<author><![CDATA[null@example.com (toxa)]]></author>
			<pubDate>Tue, 10 Dec 2019 09:18:35 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=2537#p2537</guid>
		</item>
		<item>
			<title><![CDATA[формат файлов в каталоге archive]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=2536#p2536</link>
			<description><![CDATA[<p>вот такой:<br /></p><div class="codebox"><pre><code>{$APPTYPE CONSOLE}
uses  windows, sysutils;

function readint(fh: THandle): longint;
begin if FileRead(fh, result, sizeof(result)) &lt;&gt; sizeof(result) then result:= -1; end;

function readstr(fh: THandle; maxlen: longint): ansistring;
var tmpc : ansichar;
    i    : longint;
begin
  i:= 0;
  setlength(result, maxlen);
  while (FileRead(fh, tmpc, sizeof(tmpc)) = sizeof(tmpc)) and (tmpc &lt;&gt; #0) do
    if (i &lt; maxlen) then begin
      inc(i);
      result[i]:= tmpc;
    end;
  setlength(result, i);
end;

function convertdatetime(adate, atime: longint): tDateTime;
var y, m, d  : integer;
    h, mi, s : integer;
begin
  d:= adate mod 100; adate:= adate div 100;
  m:= adate mod 100; adate:= adate div 100;
  y:= adate;
  s:= atime mod 100; atime:= atime div 100;
  mi:= atime mod 100; atime:= atime div 100;
  h:= atime;
  result:= encodedate(y, m , d) + encodetime(h, mi, s, 0);
end;

type tCandle = packed record
       o, h, l, c, v : double;
       d, t          : longint;
     end;
var  fname : ansistring;
     fh    : THandle;
     cndl  : tCandle;
     len   : longint;

begin
  fname:= paramstr(1);
  if fileexists(fname) then begin
    fh:= FileOpen(fname, fmOpenRead or fmShareDenyNone);
    try
      writeln(&#039;ver: &#039;, readint(fh));
      writeln(&#039;ID: &#039;, readstr(fh, 4096));
      repeat
        len:= FileRead(fh, cndl, sizeof(cndl));
        if len = sizeof(cndl) then
          with cndl do
            writeln(format(&#039;o: %.5f h: %.5f l: %.5f c: %.5f v: %.5f ts: %s&#039;,
                           [o, h, l, c, v, formatdatetime(&#039;DD-MM-YYYY HH:NN:SS&#039;, convertdatetime(d, t))]));
      until len &lt;&gt; sizeof(cndl);
    finally FileClose(fh); end;
  end else writeln(&#039;File &#039;, fname, &#039; not found!&#039;);
end.</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (toxa)]]></author>
			<pubDate>Tue, 10 Dec 2019 09:12:56 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=2536#p2536</guid>
		</item>
	</channel>
</rss>
