Purpose
Check if a string consists of a given amount of digits

Solution Use the Set command with regex=
GuiXT
Set V[dx] "&V[checkstring]" regex="^\d{7}$"
if Q[ok]
  Text (1,1) "V[checkstring] (&V[checkstring]) consists of 7 digits."
else
  Text (1,1) "V[checkstring] (&V[checkstring]) does not consist of 7 digits."
endif

Explanation: The regular expression passed to regex= consists of the following components:
^ asserts the start of the string.
\d{7} matches exactly 7 digits (\d is shorthand for any digit, and {7} specifies the count).
$ asserts the end of the string.

Components: InputAssistant