Hi DM. How does a %s be used as a number and at the same time it's also a word?
Re: % specifiers
By: The Millionaire to Digital Man on Fri Apr 03 2020 03:30 pm
A string of characters can contain decimal digits (i.e. '0'-'9'). Or it might consist of only decimal digits, but still be a string.
digital man
Synchronet "Real Fact" #17:
"Vertrauen" (ver-trow-en) translates to "trust" in German, and was a band name. Norco, CA WX: 66.6°F, 53.0% humidity, 7 mph E wind, 0.00 inches rain/24hrs
Re: % specifiers
By: The Millionaire to Digital Man on Fri Apr 03 2020 03:30 pm
A string of characters can contain decimal digits (i.e. '0'-'9'). Or it might consist of only decimal digits, but still be a string.
But how does the text.dat know which %s it's using on the lines?
Re: % specifiers
By: The Millionaire to Digital Man on Fri Apr 03 2020 03:38 pm
The order and type of the %-specifiers is significant. You can't re-arrange them. If you have a text.dat string with "%d %s", you can't change that to "%s %d" or the BBS will crash (for example).
digital man
This Is Spinal Tap quote #6:
David St. Hubbins: He was the patron saint of quality footwear.
Norco, CA WX: 66.6°F, 54.0% humidity, 10 mph NE wind, 0.00 inches rain/24hrs
Re: % specifiers
By: The Millionaire to Digital Man on Fri Apr 03 2020 03:38 pm
The order and type of the %-specifiers is significant. You can't re-arrange them. If you have a text.dat string with "%d %s", you can't change that to "%s %d" or the BBS will crash (for example).
For example (not real examples):
"You have no %s." 001 NoMail
"There are %s messages on the system." 002 NumberOfSystemMsgs
Hi DM. How does a %s be used as a number and at the same time it's also a word?
| Sysop: | Ragnarok |
|---|---|
| Location: | Dock Sud, Bs As, Argentina |
| Users: | 137 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 120:47:06 |
| Calls: | 15,363 |
| Calls today: | 1 |
| Files: | 20,059 |
| D/L today: |
10 files (2,018K bytes) |
| Messages: | 1,798,945 |