Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Defining a Memo (from table) as a calculated field

Posted on 1997-05-14
5
Medium Priority
?
546 Views
Last Modified: 2010-04-04
I am using Quick Report and need to create a calculated field from a memo. The only way I have found you can do this is to create a string field of say 1000 chars and then use:-
     Table1CalcString1000.AsString := '';            // Calculated note field of length 1000
     Table1CalcString1000.AsString := Table1NotesMemo1.AsString + Table1NotesMemo2.AsString;
The problem with this method is that the memo may grow beyond the 1000 characters and then the string is truncated. Can you suggest a better method?
0
Comment
Question by:Eric Kay
[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
  • 2
  • 2
5 Comments
 
LVL 2

Expert Comment

by:javiertb
ID: 1336264
As far as I know, Strings can only hold up to 255 chars and if you want to have more chars stored you have to use an AnsiString variable, but there's not an AnsiString TField. Were you able to put 1000 chars in a TStringField? Maybe you should use a calculated memo field to write your data in.
0
 

Author Comment

by:Eric Kay
ID: 1336265
Setting it to 1000 works OK, The problem is that you CAN'T create a calculated memo field. Try it.
0
 
LVL 2

Expert Comment

by:javiertb
ID: 1336266
Yes, you CAN. I simply used the Fields Editor, created new calculated Memo field (with a size of 65535 or less) and that's it. Couldn't you do it?

0
 

Author Comment

by:Eric Kay
ID: 1336267
You must have had the table closed, try doing the same thing with the table active. It enables you to do it with the table inactive, but as soon as you try to activate the table an error is generated.
0
 
LVL 1

Accepted Solution

by:
ygolan earned 100 total points
ID: 1336268
Eric,

Define a calculated BLOB field instead of Memo. You can use Assign to copy the values between the memo and the blob.  Here is some sample code :

Table1CalcBlob.Assign(Table1NotesMemo1.AsString + Table1NotesMemo2.AsString);

... And in Delphi 2 and Delphi 3 strings can be of any length up to 2GB.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

609 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