Solved

Memo.Lines question

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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Show Listview image from database (String field) 5 187
creating threads in delphi 1 202
Create a path if not exists 7 125
Dev express lookupcombo 3 64
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

739 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