Hi all -

I'm trying to build a dynamic array of words to display in a list, but I'm
running into a stumbling block.  It must be my lack of C experience.  Here
are some excerpts from my code:


// Global array
Char WordArray[30][11];  // The list of words, 30 words, max length = 10
characters per word

// Function declaration
void MainListDraw(Int16 itemNum, RectangleType *bounds, char **ItemsText);


// In MainFormHandleEvent...
        case frmOpenEvent:
                frmP = FrmGetActiveForm();
                MainFormInit( frmP );
                lstP = FrmGetObjectPtr(frmP,FrmGetObjectIndex(frmP, MainWordList));
                LstSetListChoices(lstP,NULL,NumWords);
                LstSetDrawFunction(lstP,MainListDraw);
                FrmDrawForm ( frmP );
//.........

        case MainOKButton:      // Add the current word to the list

                // Add chrWord to the list
                StrCopy(WordArray[NumWords++], chrWord);
                LstDrawList(lstP);  // ***** PROBLEM HERE! *****
//.........

void MainListDraw(Int16 itemNum, RectangleType *bounds, char **ItemsText)
{
        WinDrawChars(WordArray[itemNum], StrLen(WordArray[itemNum]),
bounds->topLeft.x, bounds->topLeft.y);
}


------------------------------------------------------
When my code hits LstDrawList(lstP); in the MainOKButton code, POSE reports
that my application has just read from low memory.  What am I doing wrong?

Thanks for any help!

- Walter


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to