![]() This sounds good, but what if the user types a letter when a number is expected? Of course, these conversion functions return an error code, so we can use it to test whether the user has really entered a number. To accomplish this, you can use the MaskEdit component (in the Additional page of the Components palette) or simply use an Edit component and then convert the input string into an integer, using the standard Pascal Val procedure or the Delphi IntToStr function. ![]() In general, it's quite common to ask users for numeric input, too. We saw in the previous example that it is very easy to use an Edit component to ask the user to input some text, although it must be limited to a single line.
0 Comments
Leave a Reply. |