I'm impressed, however, I'm using neither FrmCopyTitle() or FrmCopyLabel in
this function. I am using it in some areas, but those areas aren't used in
this scenario. There is a label, Pharmacy:, on my form and it is the last
one.
Here is the code:
static Boolean ViewRx(Word wSelection)
{
RxRecord* pRec;
// initialize the form
FormPtr pForm = FrmInitForm(ViewRxForm);
// get the entry
Word wRow = 0;
pCurrentRx = pRxListHead;
while (wRow != wSelection)
{
if (pCurrentRx != NULL) pCurrentRx = pCurrentRx->GetNext();
wRow++;
}
// show the entry
if (pCurrentRx != NULL)
{
pRec = pCurrentRx->GetRx();
// show the patient name
CharPtr pPatName = (CharPtr) MemPtrNew(StrLen(pRec->szPatName) + 1);
StrCopy(pPatName, "");
StrCopy(pPatName, pRec->szPatName);
FieldPtr pPatNameField = (FieldPtr) FrmGetObjectPtr(pForm,
FrmGetObjectIndex(pForm,
ViewRxPatientField));
FldSetTextPtr(pPatNameField, pPatName);
// show the drug name
CharPtr pDrugName = (CharPtr) MemPtrNew(StrLen(pRec->szDrugName) + 1);
StrCopy(pDrugName, "");
StrCopy(pDrugName, pRec->szDrugName);
FieldPtr pDrugNameField = (FieldPtr) FrmGetObjectPtr(pForm,
FrmGetObjectIndex(pForm,
ViewRxDrugField));
FldSetTextPtr(pDrugNameField, pDrugName);
// show the rx refills
CharPtr pRefills = (CharPtr) MemPtrNew(StrLen(pRec->szRefills) + 1);
StrCopy(pRefills, "");
StrCopy(pRefills, pRec->szRefills);
FieldPtr pRefillsField = (FieldPtr) FrmGetObjectPtr(pForm,
FrmGetObjectIndex(pForm,
ViewRxRefillsField));
FldSetTextPtr(pRefillsField, pRefills);
// show the rx dispense
CharPtr pDispense = (CharPtr) MemPtrNew(StrLen(pRec->szDispense) + 1);
StrCopy(pDispense, "");
StrCopy(pDispense, pRec->szDispense);
FieldPtr pDispenseField = (FieldPtr) FrmGetObjectPtr(pForm,
FrmGetObjectIndex(pForm,
ViewRxDispenseField));
FldSetTextPtr(pDispenseField, pDispense);
// show the rx date entered
CharPtr pEntered = (CharPtr) MemPtrNew(StrLen(pRec->szDateEntered) + 1);
StrCopy(pEntered, "");
StrCopy(pEntered, pRec->szDateEntered);
FieldPtr pEnteredField = (FieldPtr) FrmGetObjectPtr(pForm,
FrmGetObjectIndex(pForm,
ViewRxEnteredField));
FldSetTextPtr(pEnteredField, pEntered);
// show the rx date expires
CharPtr pExpires = (CharPtr) MemPtrNew(StrLen(pRec->szDateExpires) + 1);
StrCopy(pExpires, "");
StrCopy(pExpires, pRec->szDateExpires);
FieldPtr pExpiresField = (FieldPtr) FrmGetObjectPtr(pForm,
FrmGetObjectIndex(pForm,
ViewRxExpiresField));
FldSetTextPtr(pExpiresField, pExpires);
// show the rx pharmacy name
CharPtr pPharmacy = (CharPtr) MemPtrNew(StrLen(pRec->szPharmacyName) + 1);
StrCopy(pPharmacy, "");
StrCopy(pPharmacy, pRec->szPharmacyName);
FieldPtr pPharmacyField = (FieldPtr) FrmGetObjectPtr(pForm,
FrmGetObjectIndex(pForm,
ViewRxPharmacyField));
FldSetTextPtr(pPharmacyField, pPharmacy);
// display the dialog
if (FrmDoDialog(pForm))
{
// do nothing
}
// destroy the form
FrmDeleteForm(pForm);
MemPtrFree(pPatName);
MemPtrFree(pDrugName);
MemPtrFree(pRefills);
MemPtrFree(pDispense);
MemPtrFree(pEntered);
MemPtrFree(pExpires);
MemPtrFree(pPharmacy);
return true;
}
return false;
}
"Ben Combee" <[EMAIL PROTECTED]> wrote in message
news:34391@palm-dev-forum...
>
> > Ken's theory is born out by looking at the values reported. In hex,
these
> are:
> >
> > 29293 = 0x7260 = 'rm'
> > 24931 = 0x6163 = 'ac'
> >
> > Since the right edge is stored as a width value, we need to subtract the
> left
> > value from the right to get the stored value:
> >
> > 60269 - 29293 = 0x7900 = 'y\0'
> >
> > So it looks like the text "rmacy" was written over your coordinate
values.
> Does
> > that ring any bells for you? Could it be the tag end of "pharmacy" or
> something?
>
> Considering a visit to www.eaglesoft.net shows that they're involved in
the
> medical software industry, I'm thinking that Keith has done some superb
> sleuthing work!
>
> FrmCopyTitle() or FrmCopyLabel()? I wonder which one it will be.
>
> --
> Ben Combee
> Veriprise Wireless <http://www.veriprise.com>
>
>
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/