> From: Todd Cary
>
> procedure PopuptriggerVariety_OnPopSelect(var Handled: Boolean;
> ControlID: UInt16; ControlP: ControlType; ListID: UInt16; ListP:
> ListType; Selection: Int16; PriorSelection: Int16);
> var
> Form: FormPtr;
> List: ListPtr;
> ListIndex: UInt16;
> P: MemPtr;
> ListText: PChar;
> begin
> FrmCustomAlert(AlertShow, 'Here I am!, '', '');
I don't see any closing quote at the end of "Here I am!" This should have
tremendously confused your compiler. Also, due to a bug in FrmCustomAlert,
you should pass in a string with at least one blank for each parameter you
don't use.
> Form := FrmGetActiveForm;
>
> //From here on I am lost!!!!
>
> //The name of the List is ListVariety
>
> ListIndex := FrmGetObjectIndex(Form, ListVariety);
What if FrmGetObjectIndex() returns frmInvalidObjectId?
> List := FrmGetObjectPtr(Form, ListIndex);
What if FrmGetObjectPtr() returns NULL?
> P := LstGetSelectionText(List, Selection);
What if P is NULL?
> ListText := MemHandleLock(P);
>
At this point ListText should point to the start of the text within the
ListType, so this can only work with a static list or one that was created
with LstSetListChoices(). If your app uses a callback function to generate
the list text, then LstGetSelectionText() will just return NULL. And that
would cause the MemHandleLock() to fail. (That's probably not what you're
doing, so this could be irrelevant. However, you should *always* verify
pointers before using them.)
At this point you should be able to insert another FrmCustomAlert() to
display the list text.
> MemHandleFree(P);
> Handled := True;
> end;
>
I don't see anything else wrong at the moment, but my Pascal is rusty.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/