SetStreamPosition::stmrng
Details
-
- This message is generated when the value of the second argument in SetStreamPosition corresponds to a position that is outside of the stream specified in the first argument.
- Off[message] switches off the message; On[message] switches it on. For example: Off[SetStreamPosition::stmrng].
Examples
Basic Examples (1)
An error occurs because the position specified in SetStreamPosition exceeds the number of characters in the test file:
Write["TESTFILE", OutputForm["ABCDEFGHOJKLMNOP"]]Close["TESTFILE"]With[{s = OpenRead["TESTFILE"]},
SetStreamPosition[s, 100];
Print["char 101 = ", Read[s, Character]];
Close[s]
]This shows a valid position specification for this file:
With[{s = OpenRead["TESTFILE"]},
SetStreamPosition[s, 10];
Print["char 11 = ", Read[s, Character]];
Close[s]
]DeleteFile["TESTFILE"]