Solved

Memo.Lines question

Posted on 1998-04-07
1
147 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

920 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