Solved

Error message:" Missing operator or semicolon"

Posted on 2008-10-07
4
1,002 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
  • 2
  • 2
4 Comments
 
LVL 13

Accepted Solution

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

Author Comment

by:QurbanDurrani
Comment Utility
rfwoolf.
Thanks for your prompt response.
0
 
LVL 13

Expert Comment

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

Author Comment

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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now