Page 1 of 1

Using Editfields (String length char-fields)

PostPosted: Fri Jul 27, 2007 3:52 am
by christian
Hello!

When using a edit-mask for editing datafields, after reading the contents of an record, all fields are filled with blank spaces, belonging to the fieldsize.

It would be nice if the fields could be right-trimmed, as the "old" NBdb-Plugin does. So the cursor is placed after the last character and not after all that spaces.

Thanks,
Christian

PostPosted: Fri Jul 27, 2007 1:28 pm
by Neosoft Support
Are you using a Text Entry field or the edit mask assigned to the grid?

What edit mask are you using?

PostPosted: Sat Jul 28, 2007 3:16 am
by christian
... the automatically by NB produced and pasted from the clipboard ones... After dbpOpenTable: "Would you like to create text entry fields ...?".
Thanks Christian

{NeoBook 5 Objects}
NeoBookVer=5,54
ObjectType=9
Name=gruppe
X=76
Y=36
W=300
H=24
Anchor=0
VarName=[drcrr.artikel.gruppe]
EditLen=35
LineColor=0
LineWidth=1
LineStyle=0
FillColor=16777215
FillPattern=0
Font=Arial
FontSize=8
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=38

PostPosted: Mon Jul 30, 2007 5:26 pm
by Neosoft Support
I think this might be a function of the database or field type you're using. I don't have Postgres, but this doesn't happen with MS Access or other databases that I can tell. Also, the Char field type is interpreted by some databases as fixed-width character field. The String field type is interpreted as variable-width character field. Different databases may store these types differently. Maybe Postgres is padding the fixed-width field type?

PostPosted: Tue Jul 31, 2007 3:51 am
by christian
Hello,
you are right :D , the problem belongs to char()!
When using varchar() it works.
So I will change my database structure for further use, it's no problem because I have not to alter my program-code.
Thanks! Christian

PostgreSQL-example:
CREATE TABLE XXX
(
menuein char(32),
idatum date,
ibestand varchar(5), <========= that works fine!
upload char(1),
)