1
votes

Is there a function to limit the number of characters a user can enter in the CLI to read in a variable?

I can limit the amount of characters a value can storage, so if i put string[4] and i enter abcdef, the variable stores just abcd.

I need to limit the number of characters a user can write. How can this be done?

This should be in standard Pascal, not Delphi.

2

2 Answers

1
votes

I would say read it character by character from CLI using ReadKey. Do this in a loop and break it if either the maximum number of characters have been reached or if the user presses return.

0
votes

Well, there is none.