Forum > Packages and Libraries
Tmemo don't control when is not visible
(1/1)
eldonfsr:
Hi i scare i have tmemo control to receive from serial port, but is not visible the content is in two tmemos
but one is for keep last result what i need to keep, generate chart but the problem is cheking if memo has a text "TEST DONE" but never found but when tmemo is visble find it and fire up DatasToChart(VMTerminal);
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TFormMain.OnDatasChart(Sender: TObject; var Str: string);Var vv,lc:Integer;begin// Vmterminal.BeginUpdateBounds; for lc:=0 to length(Str) do begin vv:=ord(Str[lc]);// VMTerminal.Text := VMterminal.Text+ '['+IntToSTr(vv)+']' + str[lc]; VMTerminal.Text := VMterminal.Text+ str[lc]; end; for lc:=0 to VMTerminal.Lines.Count-1 do begin if( VMTerminal.Lines[lc]='') then begin VmTerminal.Lines.Delete(lc); end; end;// Vmterminal.EndUpdateBounds; if(AnsiContainsText(VMTerminal.Text,'Single cycle') ) then begin if( (Chart1.Visible=false) and (Not AnsiContainsText(VMTerminal.Text,'MD')) and (not AnsiContainsText(VMTerminal.Text,'>'))) then begin PanelChart.Height:=210; PanelChart.Visible:=true; PanelBtnsAcc.Visible:=false; end; end; if( AnsiContainsText(VMTerminal.Text,'TEST DONE') and (PanelChart.Visible= true) and (AnsiContainsText(VMTerminal.Text,'>'))) then Begin if(ChartCount <=10) then begin DatasToChart(VMTerminal); end else begin ChartCount:=1; DatasToChart(VMTerminal); end; chart1.Repaint; end;// Vmterminal.Text:= Trim(Vmterminal.Text); ComTerm.SetFocus;end;
Joanna from IRC:
--- Quote --- for lc:=0 to length(Str) do begin
vv:=ord(Str[lc]);
--- End quote ---
What is that part for? Testing?
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---for lc:=0 to VMTerminal.Lines.Count-1 do begin if( VMTerminal.Lines[lc]='') then begin VmTerminal.Lines.Delete(lc); end;That code is wrong. If any lines are deleted you will no longer be referencing lines correctly. I would do
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- With VMTerminal do for lc:= Lines.Count-1 downto 0 to do if (Lines[lc]='') then Lines.Delete(lc);
eldonfsr:
OK i can change thanks...
Navigation
[0] Message Index