Announcement

Collapse
No announcement yet.

Multiple KbHandlers

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

  • Multiple KbHandlers

    Hi I'm working on project that has to many keyboards and buttons. I want to have a different kbHandler for each keyboard and I tried to call the handler in the kbdown of each keyboard, but when I download the project it doesn't display any of the images of the project. Help Please!

  • #2


    Here is what I'm doing

    switch
    case ((n >= iKeyboard1) && (n = iKeyboard2) && (n = iKeyboard3) && (n = iKeyboard4) && (n = iKeyboard5) && (n = iKeyboard7) && (n

    Comment


    • #3


      You say
      I download the project it doesn't display any of the images of the project
      If you look at the keyboard demo it has

      img_Show(hndl,ikeyboard1) ; // show initialy, if required
      for (i := ikeyboard1+1; i
      Mark

      Comment


      • #4


        yes, I have that for each of the keyboards, here is one of them...

        [HTML]img_Show(hndl,iKeyboard4) ; // show initial keyboard
        for (i := iKeyboard4+1; i

        Comment


        • #5


          If you aren't getting any images then

          1) have you mounted the disk?
          2) is it FAT formatted?
          3) Have you copied the files?
          4) have you loaded the image control? (with names matching what was copied)
          Mark

          Comment


          • #6


            1) Yes
            2)Yes
            3)Yes
            4)Yes

            If I comment out the keyboard code the images come back...

            Comment


            • #7


              Are you running out of memory and not having enough left to load the image control?

              Can you zip up and attach the entire project (including the imgdata folder)?
              Mark

              Comment


              • #8
                So we've narrowed it down to a function I'm calling in one of the Handlers...

                in that handler I get a numeric pin code and save it to a buffer and then call that function to compare that pin number with stored values. If I comment out the function that compares the pin everything works fine... but I have no errors in the code when compiling...

                Here is the function... The Handler that calls this function is KBHandlerD in the attached code

                func CodeMatch()
                var count;
                var match;
                var index;
                //var linebuf[50]; // 100 byte temp line buffer
                var mLines[50];

                to (admin);putstr("admin");
                to (clerk);putstr("clerk");

                pwdhndl := file_Open("pwd.csv", 'r');

                count:=0;


                //file_Rewind(pwdhndl);
                while(file_GetS(k1, 100, pwdhndl)) // for each line,
                if(count==0)
                to(mLines);putstr(k1);
                else
                to(APPEND);putstr(k1);
                endif
                count++;
                wend

                //putstr(mLines);
                putch('\n');
                putch('\n');
                var acct_type[6];

                na:=str_Ptr(mLines);
                if ( n3 := str_Find( &na, codebuffer ) )
                n3 := n3 + 5;
                to(acct_type); str_Printf(&n3,"%5s\n");
                //print("Match found\n");
                else

                Form4();
                print("\nUsuario No Encontrado");
                endif

                n2:=str_Ptr(acct_type);
                if(n4:= str_Find(&n2, admin ))
                Form6();
                else if (n4:= str_Find(&n2, clerk ))
                Form5();
                else
                //print("Usuario No Encontrado");
                endif

                file_Close(pwdhndl);

                endfunc

                Comment


                • #9


                  Without having any idea what your file looks like I'd want something in there to make sure you aren't going way beyong the end of mLines
                  Mark

                  Comment


                  • #10


                    here is the file that I'm using

                    Attached files PWD.zip (174 B)

                    Comment


                    • #11


                      Where /what is k1 initialised to before this routine is called?
                      Mark

                      Comment


                      • #12


                        k1 is initialized in the beginning of the project before all functions

                        Comment


                        • #13


                          So it's set to the address of an array?
                          Mark

                          Comment


                          • #14


                            It's an empty array and I use it to store the data from the file...

                            var k1[50];

                            Comment


                            • #15


                              A couple of things to try first ,

                              1] Place a print(mem_Heap()); after you load all the image controls so we know the limits.

                              2] If you havn't already done so, place

                              #MODE RUNFLASH

                              in your program so that its not wasting any RAM as codespace.
                              Regards,
                              Dave

                              Comment

                              Working...
                              X