MCPcopy Create free account
hub / github.com/CruiserOne/Astrolog / NInputRange

Function NInputRange

io.cpp:2491–2503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2489// make sure it conforms to the specified bounds before returning it.
2490
2491int NInputRange(CONST char *szPrompt, int low, int high, int pm)
2492{
2493 char szLine[cchSzDef];
2494 int n;
2495
2496 loop {
2497 InputString(szPrompt, szLine);
2498 n = NParseSz(szLine, pm);
2499 if (FBetween(n, low, high))
2500 return n;
2501 sprintf(szLine, "Value %d out of range from %d to %d.", n, low, high);
2502 PrintWarning(szLine);
2503 }
2504}
2505
2506

Callers 1

FInputDataFunction · 0.85

Calls 3

InputStringFunction · 0.85
NParseSzFunction · 0.85
PrintWarningFunction · 0.85

Tested by

no test coverage detected