Announcement

Collapse
No announcement yet.

Multiple KbHandlers

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

  • LoLa
    replied


    Thanks a lot! set #MODE RUNFLASH and it worked great!

    Leave a comment:


  • meldavia
    replied


    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.

    Leave a comment:


  • LoLa
    replied


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

    var k1[50];

    Leave a comment:


  • ESPsupport
    replied


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

    Leave a comment:


  • LoLa
    replied


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

    Leave a comment:


  • ESPsupport
    replied


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

    Leave a comment:


  • LoLa
    replied


    here is the file that I'm using

    Attached files PWD.zip (174 B)

    Leave a comment:


  • ESPsupport
    replied


    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

    Leave a comment:


  • LoLa
    replied
    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

    Leave a comment:


  • ESPsupport
    replied


    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)?

    Leave a comment:


  • LoLa
    replied


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

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

    Leave a comment:


  • ESPsupport
    replied


    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)

    Leave a comment:


  • LoLa
    replied


    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

    Leave a comment:


  • ESPsupport
    replied


    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

    Leave a comment:


  • LoLa
    replied


    Here is what I'm doing

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

    Leave a comment:

Working...
X