Solved

Error message:" Missing operator or semicolon"

Posted on 2008-10-07
4
1,007 Views
Last Modified: 2012-05-05
Hi experts.
I am trying to parse a string into various components and am not sure what I am doing wrong. I am attaching the code. The error is received on the line "protocol :=  protocol + tempstr(i);"
procedure TMainForm.ViewGroupClick(Sender: TObject);
var
  i: integer;
  tempstr, protocol, port, RA, disp, point : string;
begin
 
  SLCGroupForm := TSLCGroupForm.Create(Application);
  SLCGroupForm.ShowModal;
 
  tempstr := '';
  protocol := '';
  port := '';
  RA := '';
  disp := '';
  point := '';
 
      case DMForm.T_SLCUnitSLC_Unit_Number.AsInteger of
      0:
      begin
        SLCGroupForm.ClientWidth := 233;
      end;
      1:
      begin
        SLCGroupForm.ClientWidth := 233;
      end;
      2:
      begin
        tempstr := DMForm.T_PointAID.AsString;
        for i := 1 to Length(tempstr) do
        begin
          repeat
          protocol :=  protocol + tempstr(i);
          i++;
          until tempstr(i) = '-';
          repeat
          port := port + tempstr(i);
          i++;
          until tempstr(i) = '-';
          repeat
          RA := RA + tempstr(i);
          i++;
          until tempstr(i) = '-';
          repeat
          disp := disp + tempstr(i);
          i++;
          until tempstr(i) = '-';
          repeat
          point := point + tempstr(i);
          i++;
          until i > Length(tempstr) ;
        end;
 
      end;
    end;  
 
 
end;

Open in new window

0
Comment
Question by:QurbanDurrani
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
rfwoolf earned 500 total points
ID: 22660682
replace "tempstr(i)"
with "tempstr[i]"
0
 

Author Comment

by:QurbanDurrani
ID: 22660975
rfwoolf.
Thanks for your prompt response.
0
 
LVL 13

Expert Comment

by:rfwoolf
ID: 22661001
No problem. Your code looks impressive for a "beginner" if your profile is correct
0
 

Author Comment

by:QurbanDurrani
ID: 22663418
Thanks rfwoolf,
I have been working with Delphi for a little while, but still feel like a beginner.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question