Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Formatsettings in Initialization section issue
Mon, Aug 31 2015 8:58 AMPermanent Link

Uli Becker

In the WebCore unit all MonthNames, DayNames etc. are 0-based arrays.
When I customize the arrays in the OnCreate event e.g., that works as
expected:

LongMonthNames[0]:='Januar';
LongMonthNames[1]:='Februar';

while moving the same code to the Initialization section of a form
(necessary for the TDateEditComboBox control), I get this error:
"Invalid month(0) specified"...

Obviously the compiler expects a 1-based array here.

Uli



Mon, Aug 31 2015 9:50 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< In the WebCore unit all MonthNames, DayNames etc. are 0-based arrays. >>

Internally, yes, but not what you would use when modifying the TFormatSettings properties.  The properties themselves are all 1-based, in order to match the month numbers.

<< When I customize the arrays in the OnCreate event e.g., that works as expected:

LongMonthNames[0]:='Januar';
LongMonthNames[1]:='Februar'; >>

Actually, no, it isn't working.  You're just seeing what happens when an exception occurs in JS during the loading of a page.  In such a case, the browser will eat the exception.  However, you can see it occurring if you run the application in an external browser with the dev tools/debugger open (F12)

IOW, use 1-based property indexes here.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Nov 24 2015 6:28 AMPermanent Link

Huseyin Aliz

myBiss ApS

Avatar

Hi Uli/Tim,

What's the best way of translating component values (here calendar
component) to show regional settings/labels?

Regards,
Hüseyin

Den 31-08-2015 kl. 15:50 skrev Tim Young [Elevate Software]:
> Uli,
>
> << In the WebCore unit all MonthNames, DayNames etc. are 0-based arrays. >>
>
> Internally, yes, but not what you would use when modifying the TFormatSettings properties.  The properties themselves are all 1-based, in order to match the month numbers.
>
> << When I customize the arrays in the OnCreate event e.g., that works as expected:
>
> LongMonthNames[0]:='Januar';
> LongMonthNames[1]:='Februar'; >>
>
> Actually, no, it isn't working.  You're just seeing what happens when an exception occurs in JS during the loading of a page.  In such a case, the browser will eat the exception.  However, you can see it occurring if you run the application in an external browser with the dev tools/debugger open (F12)
>
> IOW, use 1-based property indexes here.
>
> Tim Young
> Elevate Software
> www.elevatesoft.com
>
Tue, Nov 24 2015 9:19 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Hüseyin,

<< What's the best way of translating component values (here calendar component) to show regional settings/labels? >>

Just assign new values to the FormatSettings properties for MonthNames, etc. in the initialization section of one of your units.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Dec 1 2015 5:58 PMPermanent Link

Huseyin Aliz

myBiss ApS

Avatar

Tim,

Thanks, works perfect Smile

Regards,
Hüseyin

On 24-11-2015 15:19, Tim Young [Elevate Software] wrote:
> Hüseyin,
>
> << What's the best way of translating component values (here calendar component) to show regional settings/labels? >>
>
> Just assign new values to the FormatSettings properties for MonthNames, etc. in the initialization section of one of your units.
>
> Tim Young
> Elevate Software
> www.elevatesoft.com
>
Image