Payable Aging Report Totals column produces error

Charles Day cedayiv at gmail.com
Tue Jun 24 13:40:33 EDT 2008


On Mon, Jun 23, 2008 at 8:09 PM, <warlord at mit.edu> wrote:

> I don't like changing people's input out from under them.


Good point.


> You'd have to perform the same parsing as strftime(), because
> you'd need to make sure that you DO NOT change %%e to %%#d,
> so you can't just blindly look for %e.  Also, adding the new
> character requires a memory change and shift.  Uggh.
>
> IMHO, if someone changes the default then they can cause lots of
> damage.  If that happens to be a crash, well..  They should know
> better.  I suspect there are lots of other ways people can cause
> the report to crash, which is fine so long as the application
> doesn't crash too.
>
> So, no, I dont like this approach.
>

OK, so I will go ahead and try to supply the default value with a global
variable as you suggested. When you said to put the declaration in
"Something core.  maybe qof-date.c" did you mean lib/libqof/qof/gnc-date.c?

By the way, for me using "%B %e, %Y" just results in "June , 2008" and no
Scheme exception. But maybe I am getting lucky.

-Charles

Sorry,
>
> -derek
>
>
> Quoting Charles Day <cedayiv at gmail.com>:
>
>  How about a slightly different approach: define a C function called
>> gnc_strftime() that substitutes %#d for %e if G_OS_WIN32 is defined. Then
>> make all the reports call gnc-strftime instead of strftime. What do you
>> think? Seems safer, since the user may manually change the setting and
>> could
>> type in %e at any time, resulting in a crash.
>>
>> -Charles
>>
>>
>> On Wed, Jun 11, 2008 at 9:57 AM, Derek Atkins <warlord at mit.edu> wrote:
>>
>>  Quoting Charles Day <cedayiv at gmail.com>:
>>>
>>>  On Wed, Jun 11, 2008 at 9:29 AM, Derek Atkins <warlord at mit.edu> wrote:
>>>
>>>>
>>>>  Charles,
>>>>
>>>>> What we really need here is the following C Code:
>>>>>
>>>>> const char* gnc_default_strftime_date_format =
>>>>> #ifdef G_OS_WIN32
>>>>>  N_("%B %#d, %Y")
>>>>> #else
>>>>>  N_("%B %e, %Y")
>>>>> #endif
>>>>>  ;
>>>>>
>>>>>
>>>>>  What C file does this belong in?
>>>>
>>>>
>>> I don't know.  Something core.  maybe qof-date.c?
>>>
>>>  Then we need to export gnc_default_strftime_format into Scheme and
>>>
>>>> use that exported string in the option generator as the default
>>>>> option value.
>>>>>
>>>>>
>>>>>  I think you've lost me here a little... could you make this change, or
>>>> explain the option generator bit in a little more detail?
>>>>
>>>>
>>> Okay, there are two things that need to happen from the scheme side:
>>>
>>> 1) we need to export gnc_default_strftime_format.  This would mean
>>> swigifying
>>>  the C symbol and exporting it to the Scheme environment.  Let's say the
>>>  scheme variable is gnc-default-strftime-format.
>>> 2) We need to go through every report and replace "%B %e, %Y" with
>>>  (_ gnc-default-strftime-format) in all the report option generators.
>>>
>>> I was sorta hoping I could convince you to make these changes ;)
>>>
>>>  But I guess you can't test since you are not using Windows... I at least
>>>
>>>> can
>>>> do that part if you tell me which report I need to run. However, bear in
>>>> mind that I don't have any business data to work with.
>>>>
>>>>
>>> No, I cannot test this on windows.
>>>
>>>  At least we will have Scheme backtraces logged now. Should make report
>>>
>>>> debugging a bit easier starting with 2.2.6. :)
>>>>
>>>>
>>> Yes indeed!   Thanks!
>>>
>>>
>>>  -Charles
>>>
>>>>
>>>>
>>> -derek
>>>
>>> --
>>>     Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
>>>     Member, MIT Student Information Processing Board  (SIPB)
>>>     URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
>>>     warlord at MIT.EDU                        PGP key available
>>>
>>>
>>>
>>
>
>


More information about the gnucash-user mailing list