Solved

Defining a Memo (from table) as a calculated field

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 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

7 Experts available now in Live!

Get 1:1 Help Now