Restricted Note Field

Restricted Note Field

Postby Ollie » Wed Sep 17, 2008 8: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)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby James Bott » Wed Sep 17, 2008 1: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 43 guests