[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Defining a Memo (from table) as a calculated field

Posted on 1997-05-14
5
Medium Priority
?
557 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
  • 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses
Course of the Month20 days, 7 hours left to enroll

868 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