Solved

Defining a Memo (from table) as a calculated field

Posted on 1997-05-14
5
485 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 50 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

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
Adoquery sql  left join does not work 25 118
I want to use librsync in my Delphi backup application. 3 82
Delphi android app hide keyboard 3 80
Firemonkey Queue list 1 50
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…
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…

737 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