Procedure

TfrmGraphs.FormatHint

Module

fGraphs

Last Modified

7/15/2014 3:26:36 PM

Visibility

Public/Published

Owner

TfrmGraphs

Declaration

procedure FormatHint(var astring: string);

Calls Hierarchy


TfrmGraphs.FormatHint
 ├TfrmGraphs.TypeString
 └TfrmGraphs.LabNameResults

Called-By Hierarchy


         TfrmGraphs.FormatHint
TfrmGraphs.timHintPauseTimer┘ 

Calls

Name Declaration Comments
TfrmGraphs.LabNameResults procedure LabNameResults(astring: string; var labname, labresult: string); -
TfrmGraphs.TypeString function TypeString(filenum: string): string; -

Called-By

Name Declaration Comments
TfrmGraphs.timHintPauseTimer procedure timHintPauseTimer(Sender: TObject); -


Source

7074  procedure TfrmGraphs.FormatHint(var astring: string);
7075  var
7076    i, j: integer;
7077    dttm, hintslice, hintformat, info, itemname, newinfo, slice, text, titlename, value: string;
7078    labresults: string;
7079  begin
7080    // hint format: slice|slice|slice| ...
7081    // where | is linebreak and slice is [text] value~[text] value~[text] value~ ...
7082    hintformat := Piece(TypeString(Piece(Piece(astring, '^', 1), ' ', 1)), '^', 9);
7083    titlename := Piece(astring, '^', 2);
7084    astring := StringReplace(astring, ' 00:00', '', [rfReplaceAll]);
7085    dttm := Piece(astring, '^', 3);
7086    if trim(Piece(astring, '^', 1)) = '63' then
7087    begin
7088      LabNameResults(astring, itemname, labresults);
7089      info := itemname + '~' + labresults + '~';
7090    end
7091    else
7092    begin
7093      itemname := Piece(astring, '^', 4);
7094      info := itemname + '~' + Piece(astring, '^', 5) + '~';
7095    end;
7096    newinfo := '';
7097    for i := 1 to BIG_NUMBER do
7098    begin
7099      hintslice := Piece(hintformat, '|', i);
7100      slice := Piece(info, '|', i);
7101      for j := 1 to BIG_NUMBER do
7102      begin
7103        text := Piece(hintslice, '~', j);
7104        value := Piece(info, '~', j);
7105        newinfo := newinfo + text + ' ' + value;
7106        //if Piece(hintslice, '~', j + 1) = '' then
7107        //  break;                                                   .
7108  
7109        if Pos('~', hintslice) = length(hintslice) then
7110          break;
7111        if Piece(slice, '~', j + 1) = '' then
7112          break;
7113      end;
7114      if Piece(hintslice, '|', i + 1) = '' then
7115        break;
7116      if length(Piece(hintformat, '|', i + 1)) > 0 then
7117        newinfo := newinfo + #13;
7118      if Piece(hintformat, '|', i + 1) = '' then
7119        break;
7120    end;
7121    astring := titlename + '  ' + dttm + #13 + newinfo; //itemname + '  ' + newinfo;
7122  end;