1) It is a TEdit text box. And the property is Text not Caption
2) The length is returning the value of 0
3) I don't remember where I saw that it was a bug, but it was on this forum somewhere
If the text string in the TEdit.Text is "3:00 PM"
Length should be returning 7 characters, not 0
3) I am not aware of any such issue in recent days. But maybe (and that could be misleading) you did read, that TEdit.Text does not return a value in the debugger. If so, that only refers to what the debugger sees. The application itself would still see the value.
Anyway, in order to help you it would be good if someone could reproduce the issue.
a) Can you try and see if it works in a new simple app
- Put a TEdit on a form
- Put a button on it
- in the button OnClick handler do: Caption := length(Edit1.Text);
Does the form's caption update according to the length of the text?
b) In your app:
- The text is entered by the user (rather than being set by the app)?
You do NOT have code like: Edit1.Text := '...'; ?
- In what procedure do you do "length(Edit.Text)" ? Triggered by what event? Some button click, some other event?
c)
Your footer says: Lazarus 2.0 w/FPC-3.0.4 • Windows 7
That does apply to the app on which you experience the issue?
Any 3rd party packages installed / used in your app (even if you think they are unrelated)?