Solved

Memo.Lines question

Posted on 1998-04-07
1
146 Views
Last Modified: 2010-04-06
Hi,
   I need to write a function which takes a line of a memo and checks each character as it goes. If it finds a character which is in a predefined subset, it should be returned. It's for an app which needs to check brackets. So if the subset of 'important' characters were '{ , }, [ ,] , ( , )' and the line in the memo was :

(information[this[ this and this]] {more gibberish}).

Then the function would put up a messagebox saying :

   '([[]]{})'
All brackets match;

I can write most of it, I just need to know how to inspect each character in the line. Anyone know how to do it?
Cheers, Nik.
0
Comment
Question by:PiersBull
1 Comment
 
LVL 1

Accepted Solution

by:
Edo082297 earned 10 total points
ID: 1361324
Hello PiersBull,

To access individual characters in your memo lines, which is of type TStrings, you could assign the line to an individual string:

  MyString := Memo1.Lines[4];

Then, you can check each individual character by doing this:

  showmessage (MyString[1]);

HTH

Regards,

Edward
0

Featured Post

Highfive Gives IT Their Time Back

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 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

24 Experts available now in Live!

Get 1:1 Help Now