No announcement yet.

Error: context error for unknown 'iUserbutton1'

  • Filter
  • Time
  • Show
Clear All
new posts

  • Error: context error for unknown 'iUserbutton1'

    After trying to get VisiGenie to allow my to have unicode user-changable text on buttons, I have moved over to use Visi instead. It does seem easier and I think it will do what I need however in an effort to tidy my experimental code, I have implemented a couple of functions that I can call instead of having all code inline.

    If however I try to do anything with a UserButton outside of main(), I get the context error.

    For example, if I have the same code within main like this:
    " img_SetWord(hndl, iUserbutton1, IMAGE_INDEX, state); // where state is 0 for up and 1 for down, or 2 total states
    img_Show(hndl,iUserbutton1) ;"

    And also put that code in a subroutine, passing in uUserButton1 as a variable, it complains.

    Basic example

    #inherit ""

    func test(var hndl, var button)
    img_SetWord(hndl, button, IMAGE_INDEX, state); // where state is 0 for up and 1 for down, or 2 total states
    img_Show(hndl,button) ;

    func test2(var foo)
    test(hndl, iUserButton1);


    hndl is a global variable defined in
    here is the content of that file:

    iUserbutton1 // offset 0x0
    iUserbutton2 // offset 0x8000
    iUserbutton3 // offset 0x10000
    iUserbutton4 // offset 0x18000
    iUserbutton5 // offset 0x20000
    iUserbutton6 // offset 0x28000

    var disk, hndl ;

    I'm obviously doing something stupid but I can't spot it. Can you help?

    I could post the whole of the real program if that helps?.?.

  • #2
    Don't worry! - spotted it...
    It was a case problem, as you will notice, the CONST specifies iUserbutton1 etc whereas the code I wrote had iUserButton1 etc - <doh!>
    Feel free to delete this post