Announcement

Collapse
No announcement yet.

Problem linking MagicEvent to Leddigit

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem linking MagicEvent to Leddigit

    In my ViSi Genie project I want to use arrow-up/arrow-down buttons to change the hours and minutes of a realtime clock.
    Inspired by the sample application 'UpDownRepeat.4DGenie', I copied both the up/down buttons and the LedDigit from the sample project to my project; I added a MagicEvent0 control to Form0, and copied the MagicEvent0.inc sample code to my MagicEvent.inc.
    This worked as expected.

    However, I cannot get this functionality working when using a LedDigits control with another name as 'LedDigits0'.
    I expect that I only would have to change the code referring to LedDigits0 to the name of the other LedDigits control (for example 'LedDigits10').
    So in the MagicEvent0 / MagicEvent1 code this would mean:

    changing:
    i := img_GetWord(hndl, iLeddigits0, IMAGE_TAG2)
    to:
    i := img_GetWord(hndl, iLeddigits10, IMAGE_TAG2)

    After this modification the numbers shown by the LedDigits don't change anymore when pressing the up/down buttons.

    What am I doing wrong ?

    Best regards,
    Bauke


  • #2
    Solved!

    After checking the code for another time I realized that the function for updating the LedDigits control should also be updated.
    When using LedDigits10 instead of LedDigits0, in function 'UpdateSend(var newval)', the following line:

    WriteObject(tLeddigits, 0, newval) ;

    should of course be changed to:

    WriteObject(tLeddigits, 10, newval) ;

    Sorry to bother you...

    Regards,
    Bauke



    Comment

    Working...
    X