Keysight VISA.NET Help
Scanf Code Snippets

Scanf Snippets

This section provides a wide variety of code snippets showing how to use Scanf with many of the possible combinations of format specifier types and modifiers. Use this section to see how to use format specifiers to get the exact parsing you need for a variety of scenarios.

In This Section

Sample Conventions

In these Scanf snippets, the format specifiers are all delimited with vertical bars, so that spaces are easily seen in the formatted result.

When the sample code uses the octal escape sequence (\###) to specify a character, the string is prefixed with an @ character.  This tells .NET to treat the escape sequence as literal characters rather than treating it as a .NET String constant escape sequence.  In this case, we want Scanf (not the .NET runtime) to process the escape sequence.

The comment for each line shows the data being parsed by the snippet, and the resulting value that is returned in the corresponding output argument, like this:

//  |<data to parse>|,  <value>

The <value> may be delimited by vertical bars if it is a string, and may be followed by a comment in parentheses.

 

 


© Keysight Technologies 2015-2025