version command behaviour...
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    ausPPC
    Posts: 543 from 2007/8/6
    From: Pending...
    Maybe I'm the only person who didn't know but it seems weird to me...

    The version command in MorphOS 2.7 stops printing the version string after it encounters the end of the second numerical sequence.

    So, a version string like this -

    $VER: SuperProgram v1 created on this sunny 26th day of May 2011

    gets output as -

    SuperProgram v1 created on this sunny 26

    What gives?
    PPC assembly ain't so bad... ;)
  • »26.05.11 - 05:22
    Profile Visit Website
  • MorphOS Developer
    CISC
    Posts: 619 from 2005/8/27
    From: the land with ...
    It's a "feature", $VER: strings are supposed to have a strict formatting, ie; "$VER: ProgramName Ver.Rev", then anything following that is considered extraneous information.

    Your $VER: string is far from this formatting, and thus reveals the shortcut the Version command uses enforcing this formatting... ;)


    - CISC
  • »26.05.11 - 06:38
    Profile
  • MorphOS Developer
    Piru
    Posts: 587 from 2003/2/24
    From: finland, the l...
    This applies to MorphOS version strings as well:
    http://openamiga.org/?function=viewpage&pageid=16

    (There are some slight differences, for example the leading \0 isn't strictly required, but is of course allowed)

    [ Edited by Piru 26.05.2011 - 19:21 ]
  • »26.05.11 - 16:19
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    ausPPC
    Posts: 543 from 2007/8/6
    From: Pending...
    Thanks for that. I've just been playing around with a text file and using a binary editor to put in the leading and trailing zeros. The openamiga.org reference mentions version strings with dates and a comment after the version and revision numbers. Given what CISC said, I guess that it's intended that the date and comment are not displayed?
    PPC assembly ain't so bad... ;)
  • »26.05.11 - 19:35
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    ausPPC
    Posts: 543 from 2007/8/6
    From: Pending...
    That's interesting (at least to me)...

    This string -

    \0 $VER: SuperProgram 1.1 (11.11.1111) comment!\0

    gets displayed as -

    SuperProgram 1.1

    But this string -

    \0 $VER: SuperProgram v1.1 (11.11.1111) comment!\0

    gets displayed as -

    SuperProgram v1.1 (11.11.1111) comment!
    PPC assembly ain't so bad... ;)
  • »26.05.11 - 19:45
    Profile Visit Website
  • MorphOS Developer
    Piru
    Posts: 587 from 2003/2/24
    From: finland, the l...
    Quote:

    The openamiga.org reference mentions version strings with dates and a comment after the version and revision numbers. Given what CISC said, I guess that it's intended that the date and comment are not displayed?

    They are displayed if you use FULL/S option.
  • »26.05.11 - 20:43
    Profile
  • MorphOS Developer
    Piru
    Posts: 587 from 2003/2/24
    From: finland, the l...
    Quote:

    This string -

    \0 $VER: SuperProgram 1.1 (11.11.1111) comment!\0

    gets displayed as -

    SuperProgram 1.1


    The date is bogus there (earliest valid amiga date is 1.1.1978), but otherwise it's ok. Use FULL/S to see the full thing.

    Quote:


    But this string -

    \0 $VER: SuperProgram v1.1 (11.11.1111) comment!\0

    gets displayed as -

    SuperProgram v1.1 (11.11.1111) comment!

    Don't do that. Do not add any extra characters before the version number.


    [ Edited by Piru 26.05.2011 - 23:47 ]
  • »26.05.11 - 20:44
    Profile