• % specifiers

    From The Millionaire@1:229/2 to All on Friday, April 03, 2020 15:30:29
    From: the.millionaire@vert.synchro.net.remove-5up-this

    To: Digital Man
    Hi DM. How does a %s be used as a number and at the same time it’s also a word?

    $ The Millionaire $

    ..."Will we ever fear the ecstasy of free thought?" - Thinkman...
    --- Synchronet 3.17c-Win32 NewsLink 1.111
    * Vertrauen - Riverside County, California - telnet://vert.synchro.net

    --- SoupGate-Win32 v1.05
    * Origin: www.darkrealms.ca (1:229/2)
  • From Digital Man@1:229/2 to All on Friday, April 03, 2020 15:36:59
    From: digital.man@vert.synchro.net.remove-104x-this

    To: The Millionaire
    Re: % specifiers
    By: The Millionaire to Digital Man on Fri Apr 03 2020 03:30 pm

    Hi DM. How does a %s be used as a number and at the same time it's also a word?

    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
    --- Synchronet 3.17c-Win32 NewsLink 1.111
    * Vertrauen - Riverside County, California - telnet://vert.synchro.net

    --- SoupGate-Win32 v1.05
    * Origin: www.darkrealms.ca (1:229/2)
  • From The Millionaire@1:229/2 to All on Friday, April 03, 2020 15:38:37
    From: the.millionaire@vert.synchro.net.remove-3xb-this

    To: Digital Man

    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


    But how does the text.dat know which %s it’s using on the lines?

    $ The Millionaire $

    ..."Will we ever fear the ecstasy of free thought?" - Thinkman...
    --- Synchronet 3.17c-Win32 NewsLink 1.111
    * Vertrauen - Riverside County, California - telnet://vert.synchro.net

    --- SoupGate-Win32 v1.05
    * Origin: www.darkrealms.ca (1:229/2)
  • From Digital Man@1:229/2 to All on Friday, April 03, 2020 15:41:58
    From: digital.man@vert.synchro.net.remove-ykw-this

    To: The Millionaire
    Re: % specifiers
    By: The Millionaire to Digital Man on Fri Apr 03 2020 03:38 pm


    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?

    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 --- Synchronet 3.17c-Win32 NewsLink 1.111
    * Vertrauen - Riverside County, California - telnet://vert.synchro.net

    --- SoupGate-Win32 v1.05
    * Origin: www.darkrealms.ca (1:229/2)
  • From The Millionaire@1:229/2 to All on Friday, April 03, 2020 15:49:13
    From: the.millionaire@vert.synchro.net.remove-zpo-this

    To: Digital Man

    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


    For example (not real examples):

    “You have no %s.” 001 NoMail
    “There are %s messages on the system.” 002 NumberOfSystemMsgs

    $ The Millionaire $

    ..."Will we ever fear the ecstasy of free thought?" - Thinkman...
    --- Synchronet 3.17c-Win32 NewsLink 1.111
    * Vertrauen - Riverside County, California - telnet://vert.synchro.net

    --- SoupGate-Win32 v1.05
    * Origin: www.darkrealms.ca (1:229/2)
  • From Digital Man@1:229/2 to All on Friday, April 03, 2020 16:05:19
    From: digital.man@vert.synchro.net.remove-rmt-this

    To: The Millionaire
    Re: % specifiers
    By: The Millionaire to Digital Man on Fri Apr 03 2020 03:49 pm


    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

    In both of those examples, those would be strings of character (text).

    digital man

    This Is Spinal Tap quote #12:
    Nigel Tufnel: Well, I don't know - wh-wh-... what're the hours?
    Norco, CA WX: 66.3�F, 55.0% humidity, 9 mph E wind, 0.00 inches rain/24hrs
    --- Synchronet 3.17c-Win32 NewsLink 1.111
    * Vertrauen - Riverside County, California - telnet://vert.synchro.net

    --- SoupGate-Win32 v1.05
    * Origin: www.darkrealms.ca (1:229/2)
  • From Rampage@1:229/2 to All on Friday, April 03, 2020 21:25:35
    From: rampage@SESTAR.remove-mmn-this

    To: The Millionaire
    Re: % specifiers
    By: The Millionaire to Digital Man on Fri Apr 03 2020 15:30:29


    Hi DM. How does a %s be used as a number and at the same time it's also a word?

    %s is a string... you really should check out the C printf formatting page(s) you've been pointed to in the past ;)


    )\/(ark

    ---
    � Synchronet � The SouthEast Star Mail HUB - SESTAR
    --- Synchronet 3.17c-Win32 NewsLink 1.111
    * Vertrauen - Riverside County, California - telnet://vert.synchro.net

    --- SoupGate-Win32 v1.05
    * Origin: www.darkrealms.ca (1:229/2)