Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Memo.Lines question

Posted on 1998-04-07
1
Medium Priority
?
155 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 40 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

Industry Leaders: 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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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 video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

927 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