Yep. Here:
static void CreateMemo( )
{
UInt16 bufsize = 0;
UInt16 index;
Char zero = 0;
Char temp;
UInt16 index2;
UInt16 attr = 0;
VoidPtr recP = NULL;
ULong bufoffset = 0;
VoidHand memoRec;
LocalID memoRecord;
Err memErr;
DmOpenRef memoDB;
memoRecord = DmFindDatabase( 0, memoDBName ); // Find the MemoDB
bufsize = StrLen( MemoBuffer );
if ( memoRecord == 0 )
{
SetFieldTextFromStr( OutputdataField, "Memo database not found." );
}
else
{
memoDB = DmOpenDatabase( 0, memoRecord, dmModeWrite );
if ( memoDB == 0 )
{
SetFieldTextFromStr( MFMainOutputdataField, "Memo
database could not be opened." );
}
else
{
index = DmNumRecords( memoDB );
memErr = TestMemory( );
memoRec = DmNewRecord( memoDB, &index, memoNewSize
);
if ( memErr == true )
{
if ( !memoRec )
{
FrmAlert( MemoryFullAlert );
DmReleaseRecord( memoDB, index, true
);
}
}
else
{
bufoffset = 0;
recP = MemHandleLock( memoRec );
for( index2 = 0; index2 <= bufsize; index2++
)
{
temp = MemoBuffer[index2];
DmSet( recP, bufoffset,
sizeof(temp), temp );
bufoffset += sizeof( temp );
}
DmSet( recP, bufoffset, sizeof(zero), zero
);
MemPtrUnlock( recP );
attr &= ~dmRecAttrCategoryMask;
DmSetRecordInfo ( memoDB, index, &attr, NULL
);
DmReleaseRecord( memoDB, index, false );
}
}
}
DmCloseDatabase( memoDB );
}
}
Hope that helps!
-Rus
>-----Original Message-----
>From: HowY [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, May 31, 2000 10:42 AM
>To: Palm Developer Forum
>Subject: Help with writing to MemoPad
>
>
>Hey!
>
>Got a quick question...
>
>Anyone writing output to the MemoPad willing to provide
>some direction as to how to open the Memo database
>and write out some text into it?
>
>A code snip would be most excellent
>
>(Sorry ifin it's been covered here before)
>
>
>
>--
>For information on using the Palm Developer Forums, or to
>unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/