discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Recursion check doesn't work in the version I compiled myself.

NH
nop head
Tue, Feb 14, 2017 4:10 PM

There is a heuristic that gets the day like this:
QDATE = $$DATE
QDATE_SPLIT = $$split(QDATE)
QDAY = $$member(QDATE_SPLIT,2)

And then finds that in the date fields it got from the system date. Why
doesn't it simply use $$__DATE as the date?

On 14 February 2017 at 15:51, Marius Kintel marius@kintel.net wrote:

On Feb 14, 2017, at 10:09, nophead nop.head@gmail.com wrote:

It was 5th of Feb when I last ran qmake but my date format has always

been

DD/MM/YYYY so I don't see why it would change between then and now.

Perhaps there is some heuristic somewhere which tries to guess which is MM
vs. DD based on the magnitude of the number?

-Marius


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

There is a heuristic that gets the day like this: QDATE = $$_DATE_ QDATE_SPLIT = $$split(QDATE) QDAY = $$member(QDATE_SPLIT,2) And then finds that in the date fields it got from the system date. Why doesn't it simply use $$__DATE as the date? On 14 February 2017 at 15:51, Marius Kintel <marius@kintel.net> wrote: > > On Feb 14, 2017, at 10:09, nophead <nop.head@gmail.com> wrote: > > > > It was 5th of Feb when I last ran qmake but my date format has always > been > > DD/MM/YYYY so I don't see why it would change between then and now. > > > Perhaps there is some heuristic somewhere which tries to guess which is MM > vs. DD based on the magnitude of the number? > > -Marius > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
MK
Marius Kintel
Tue, Feb 14, 2017 4:22 PM

On Feb 14, 2017, at 11:10, nop head nop.head@gmail.com wrote:

There is a heuristic that gets the day like this:
QDATE = $$DATE
QDATE_SPLIT = $$split(QDATE)
QDAY = $$member(QDATE_SPLIT,2)

And then finds that in the date fields it got from the system date. Why doesn't it simply use $$__DATE as the date?

I have no idea where $$__DATE would come from..

As you’re one of the few people having built OpenSCAD on Windows natively, you might very well be the first person to encounter this.
If you have any ideas for how to clean this up, please do.

-Marius

> On Feb 14, 2017, at 11:10, nop head <nop.head@gmail.com> wrote: > > There is a heuristic that gets the day like this: > QDATE = $$_DATE_ > QDATE_SPLIT = $$split(QDATE) > QDAY = $$member(QDATE_SPLIT,2) > > And then finds that in the date fields it got from the system date. Why doesn't it simply use $$__DATE as the date? > I have no idea where $$__DATE would come from.. As you’re one of the few people having built OpenSCAD on Windows natively, you might very well be the first person to encounter this. If you have any ideas for how to clean this up, please do. -Marius
NH
nop head
Tue, Feb 14, 2017 5:20 PM

Sorry I meant to type $$DATE. Googling around it seems to be an
undocumented variable in QMake. https://wiki.qt.io/Undocumented_QMake

It currently looks like this: Tue Feb 14 16:59:08 2017

So it seems that the day and year could be extracted from that but the
month is not in numeric form. So it gets the Windows date, which is all
numeric, but the order depends on the locale. So it finds the year by
looking for the four digit field and, if first, it assumes  YYYY/MM/DD, If
last it decides between DD/MM/YYYY and MM/DD/YYYY by looking for a match on
the day field from $$DATE. That would be ambiguous when the day equals
the month but it doesn't matter which order if they are both the same.

I am guessing it goes wrong when the day is less than 10 because the DATE
format probably doesn't include the leading 0 but Windows date /t probably
does. I will have to wait until next month to be sure because DATE is
undocumented!

On 14 February 2017 at 16:22, Marius Kintel marius@kintel.net wrote:

On Feb 14, 2017, at 11:10, nop head nop.head@gmail.com wrote:

There is a heuristic that gets the day like this:
QDATE = $$DATE
QDATE_SPLIT = $$split(QDATE)
QDAY = $$member(QDATE_SPLIT,2)

And then finds that in the date fields it got from the system date. Why

doesn't it simply use $$__DATE as the date?

I have no idea where $$__DATE would come from..

As you’re one of the few people having built OpenSCAD on Windows natively,
you might very well be the first person to encounter this.
If you have any ideas for how to clean this up, please do.

-Marius


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Sorry I meant to type $$_DATE_. Googling around it seems to be an undocumented variable in QMake. https://wiki.qt.io/Undocumented_QMake It currently looks like this: Tue Feb 14 16:59:08 2017 So it seems that the day and year could be extracted from that but the month is not in numeric form. So it gets the Windows date, which is all numeric, but the order depends on the locale. So it finds the year by looking for the four digit field and, if first, it assumes YYYY/MM/DD, If last it decides between DD/MM/YYYY and MM/DD/YYYY by looking for a match on the day field from $$_DATE_. That would be ambiguous when the day equals the month but it doesn't matter which order if they are both the same. I am guessing it goes wrong when the day is less than 10 because the _DATE_ format probably doesn't include the leading 0 but Windows date /t probably does. I will have to wait until next month to be sure because _DATE_ is undocumented! On 14 February 2017 at 16:22, Marius Kintel <marius@kintel.net> wrote: > > On Feb 14, 2017, at 11:10, nop head <nop.head@gmail.com> wrote: > > > > There is a heuristic that gets the day like this: > > QDATE = $$_DATE_ > > QDATE_SPLIT = $$split(QDATE) > > QDAY = $$member(QDATE_SPLIT,2) > > > > And then finds that in the date fields it got from the system date. Why > doesn't it simply use $$__DATE as the date? > > > I have no idea where $$__DATE would come from.. > > As you’re one of the few people having built OpenSCAD on Windows natively, > you might very well be the first person to encounter this. > If you have any ideas for how to clean this up, please do. > > -Marius > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >