B4J Question Paint fail to initialise ?

Discussion in 'B4J Questions' started by hookshy, Jul 16, 2015.

  1. hookshy

    hookshy Well-Known Member Licensed User

    I have a process variable
    dim pipecolor as paint    pipecolor= fx.Colors.Blue
    and I face sometimes the problem when using its variable like
    object should be first initialised paint ...on this line :

    when I try to fix this with :

    If pipecolor.IsInitialized=False Then
    End If
    I get null pointer exception error ...

    How should I handle this paint object to skip initialisation errors ?
  2. Roycefer

    Roycefer Well-Known Member Licensed User

    I've run into that problem, too. I think the best solution is to store your "color" variables as Ints, as follows:
    Dim pipecolor As Int = fx.Colors.To32Bit(fx.Colors.Blue)
    and then when you want to set a color of something, use:
  3. hookshy

    hookshy Well-Known Member Licensed User

    Sometimes it feels like I have to pass the see :rolleyes: , but thanks guys ...when did you had time to learn so much
    Thank you