Announcement

Collapse
No announcement yet.

error using or assigning constants to #DATA

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

  • error using or assigning constants to #DATA

    hi,
    #CONST
    key_wd 60 // key width
    key_ht 40 // key height
    key_spc 3 // space in between keys
    frame_spc 4 // space between frame edge and keys or output box
    info_spc 4 // vertical space between info boxes
    info_ht 50 // vertical height of info box
    out_ht 32 // vertical height of output box
    np_st_x 221 // x co-ordinate of the start of the numpad
    np_st_y 1 // y co-ordinate of the start of the numpad
    #END
    /**
    * key positions calculated from above dimensions
    * use for outlines or sense touch area of individual keys and return values when pressed
    */
    #CONST
    /** WARNING, dont change order these are calculated consecutively */
    // frame dimensions
    np_frame_x0 := np_st_x
    np_frame_y0 := np_st_y
    np_frame_x1 := np_frame_x0 + (frame_spc*2) + (key_spc*3) + (key_wd*4)
    np_frame_y1 := np_frame_y0 + (frame_spc*2) + (info_spc*2) + (key_spc*3) + (key_ht*4) + info_ht + out_ht
    np_frame_val := 18
    #END

    #DATA
    word npk_frame np_frame_x0, np_frame_y0, np_frame_x1, np_frame_y1
    #END

    if i print out these with "putnumXY" i get these results
    for constants
    np_frame_x0 = 221 // correct
    np_frame_y0 = 1 // correct
    np_frame_x1 = 478 // correct
    np_frame_y1 = 260 // correct

    but when trying to reference #DATA types, these are the results which are all wrong
    npk_frame[0] = 477
    npk_frame[1] = -8703
    npk_frame[2] = 3294
    npk_frame[3] = -7924

    can anyone tell me what is going on
    Cheers


    Last edited by joeblow; 29th December 2017, 10:14 PM.
Working...
X