Forums › Forums › SIMPOL Programming › SBLNumSettings.new() !!! GPF if no rigt parameters are passed
- This topic has 2 replies, 2 voices, and was last updated 10 years, 6 months ago by Giancarlo Cavadini.
- AuthorPosts
- October 20, 2013 at 8:58 am #249Giancarlo CavadiniParticipant
Hi Neil, I made my first small application using the examples provided with addressbook and sbair and verified strange effects using the SBLNumSettings.new() function. In practice, if the parameters are not correctly passed the program crashes with a GPF. After several experiments I think I found the solution and I commented my code as follows: // WARNING: SBLNumSettings.new() // – If the last parameter passed to the function SBLNumSettings.new() // (Boolean “CurrencySuffix”) has the value .false then the // first parameter (string “CurrencySymbol”) MUST have // Value == “” (empty string) i.e.: // me.__app.SBLlocale.numlocale =@ SBLNumSettings.new(“”, “‘”, “.”, .false) // // – If the last parameter passed to the function SBLNumSettings.new() // (Boolean “CurrencySuffix”) has the value .true then the // First parameter (string “CurrencySymbol”) MUST be // One-letter words, e.g. “⬔, and CAN NOT BE e.g. “CHF” i.e.: // me.__app.SBLlocale.numlocale =@ SBLNumSettings.new(“⬔, “‘”, “.”, true) is that correct? Saluti Giancarlo
October 21, 2013 at 10:22 am #1577MichaelKeymasterOn 20/10/2013 09:58, Giancarlo wrote:
> Hi Neil,
> I made my first small application using the examples provided with
> addressbook and sbair and verified strange effects using the
> SBLNumSettings.new() function.
> In practice, if the parameters are not correctly passed the program
> crashes with a GPF.
> After several experiments I think I found the solution and I
> commented my code as follows:
>
> // WARNING: SBLNumSettings.new()
> // – If the last parameter passed to the function SBLNumSettings.new()
> // (Boolean "CurrencySuffix") has the value .false then the
> // first parameter (string "CurrencySymbol") MUST have
> // Value == "" (empty string) i.e.:
> // me.__app.SBLlocale.numlocale =@ SBLNumSettings.new("", "'", ".", .false)
> //
> // – If the last parameter passed to the function SBLNumSettings.new()
> // (Boolean "CurrencySuffix") has the value .true then the
> // First parameter (string "CurrencySymbol") MUST be
> // One-letter words, e.g. "â¬", and CAN NOT BE e.g. "CHF" i.e.:
> // me.__app.SBLlocale.numlocale =@ SBLNumSettings.new("â¬", "'", ".",
> true)
>
> is that correct?
> Saluti
> Giancarlo
>Hi Giancarlo,
me.__app.SBLlocale.numlocale =@ SBLNumSettings.new("â¬", "'", ".", true)
The above line is almost correct, the true is missing the . at the beginning. If you use the Euro symbol by typing it, you may
have a problem if you are saving in *.sma format. As an alternative, you can use "{20ac}", which is the Unicode value for the Euro
symbol.If it crashes out and shows nothing, that is typically the result of a syntax error. If it GPFs, then that is something else
entirely, though I wouldn't expect this code to do that. One thing that SIMPOL code can often do, is check the input for being
within range, etc. before using it, but it can't do anything about being passed the wrong type, or an invalid object.Ciao, Neil
October 21, 2013 at 1:34 pm #2331Giancarlo CavadiniParticipantNeil Robinson wrote:
>
> On 20/10/2013 09:58, Giancarlo wrote:
>> Hi Neil,
>> I made my first small application using the examples provided with
>> addressbook and sbair and verified strange effects using the
>> SBLNumSettings.new() function.
>> In practice, if the parameters are not correctly passed the program
>> crashes with a GPF.
>> After several experiments I think I found the solution and I
>> commented my code as follows:
>>
>> // WARNING: SBLNumSettings.new()
>> // – If the last parameter passed to the function SBLNumSettings.new()
>> // (Boolean "CurrencySuffix") has the value .false then the
>> // first parameter (string "CurrencySymbol") MUST have
>> // Value == "" (empty string) i.e.:
>> // me.__app.SBLlocale.numlocale =@ SBLNumSettings.new("", "'", ".", .false)
>> //
>> // – If the last parameter passed to the function SBLNumSettings.new()
>> // (Boolean "CurrencySuffix") has the value .true then the
>> // First parameter (string "CurrencySymbol") MUST be
>> // One-letter words, e.g. "�", and CAN NOT BE e.g. "CHF" i.e.:
>> // me.__app.SBLlocale.numlocale =@ SBLNumSettings.new("�", "'", ".",
>> true)
>>
>> is that correct?
>> Saluti
>> Giancarlo
>>
>
> Hi Giancarlo,
>
> me.__app.SBLlocale.numlocale =@ SBLNumSettings.new("�", "'", ".", true)
>
> The above line is almost correct, the true is missing the . at the
> beginning. If you use the Euro symbol by typing it, you may
> have a problem if you are saving in *.sma format. As an alternative, you
>can use "{20ac}", which is the Unicode value for the Euro
> symbol.
>
> If it crashes out and shows nothing, that is typically the result of a
> syntax error. If it GPFs, then that is something else
> entirely, though I wouldn't expect this code to do that. One thing that
> SIMPOL code can often do, is check the input for being
> within range, etc. before using it, but it can't do anything about being
> passed the wrong type, or an invalid object.
>
> Ciao, Neilof course. . . working too many hours continuously then you make the most
stupid mistakes.
Saluti
Giancarlo - AuthorPosts
- You must be logged in to reply to this topic.