Name

scan

scan string format varName...

Parse fields from the string string according to the ANSI C scanf( ) -style format format and place results in the specified variables. Return the number of conversions, or −1 if unable to match any fields. Format placeholders have the form %[*] [width]char, where * discards the field, width is an integer, and possible values of char are as follows:

d

Decimal

o

Octal

x

Hex

c

Char to int

e

Float

f

Float

g

Float

s

String (no whitespace)

[chars]

Chars in given range

[^chars]

Chars not in given range

Get Tcl/Tk in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.