Skip to content

SBLNumSettings.new() !!! GPF if no rigt parameters are passed

Forums Forums SIMPOL Programming SBLNumSettings.new() !!! GPF if no rigt parameters are passed

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #249
    Giancarlo Cavadini
    Participant

    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

    #1577
    Michael
    Keymaster

    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, Neil

    #2331
    Giancarlo Cavadini
    Participant

    Neil 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, Neil

    of course. . . working too many hours continuously then you make the most
    stupid mistakes.
    Saluti
    Giancarlo

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.