FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Restricted Note Field
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Restricted Note Field
Posted: Wed Sep 17, 2008 08:35 AM

I want to create a General Notes field in my program.

I have heard that MEMO fields become unstable and so I want to create the largest text field I can (254 chars).

If I use a MEMOEDIT (for multi-line editing) function, and the user types more than 254 chars, it simply truncates it, which is not user friendly. I want it to BEEP and restrict the amount he can type (like edit fields do).

  1. Am I wrong about Memo fields?
  2. Can I use a Character field in this way? (or is there a better way)
Many thanks

Ollie.



Using:

xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)

Borland C++ 5.5.1

FWH 9.04 (2009 Apr)
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Restricted Note Field
Posted: Wed Sep 17, 2008 01:07 PM

You could use oGet:bChange to check the length of the data and beep or whatever.

Or, you could create your own version of a memo field in a separate file. You need two fields, one for the primary key and another for the text. You use a one-to-many relationship so you can have as many records in the memo file as you need for each record in the main file. You would also have to write code to chop the full length memo into pieces to store it, and more code to paste it all back together. You also need be able to auotmatically add and delete records as needed.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion