Created
July 28, 2017 20:39
-
-
Save dario61081/63398f62fba7ddf31cc7544b0fd6b5e7 to your computer and use it in GitHub Desktop.
Uso del gettext settext de un tfield
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| procedure TForm1.Table1CategoryGetText(Sender: TField; | |
| var Text: String; DisplayText: Boolean); | |
| begin | |
| case Sender.AsInteger of | |
| 1: Text := 'Electrical'; | |
| 2: Text := 'Agricultural'; | |
| else | |
| Text := '[Error]'; | |
| end; | |
| end; | |
| procedure TForm1.Table1CategorySetText(Sender: TField; | |
| const Text: String); | |
| begin | |
| if Text = 'Electrical'then | |
| Sender.Value := 1 | |
| else if Text = 'Agricultural' then | |
| Sender.Value := 2 | |
| else | |
| raise Exception.Create ('Error in Category field conversion'); | |
| end; | |
| end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment