On Sun, 2005-04-10 at 11:50 -0400, Matt Needles wrote: > I have searched and re-searched the online help, but the Type statement > is not documented, it seems. > > Also the construct used below in declaring a string variable to be of a > certain length is not documented, either. > > On a related note, I tried using it with the following macro code and > got the error indicated by the REM lines in the code: > > Option Explicit >
Don't you need soemthing like Dim Type AS Object Before you try using it? IIRC you forget to declare correctly, the entity defaults to single. > Type tAddrRec > sRecType as string * 1 ' "I" for persons, "O" for Organizations > sRecStatus as string * 1' "A" active, "D" deleted, "H" held > iRecID as integer ' starts with 1 > sLName as string * 35 > sFname as string * 35 > sAddr1 as string * 35 > sAddr2 as string * 35 > sCity as string * 25 > sState as string * 5 > sPostal as string * 10 > iCtryCode as integer > sPhone1 as string * 15 > sPhone2 as string * 15 > sPhone3 as string * 15 > sEmail as string * 64 > sNotes as string * 60 > End Type > > Sub Main > Dim myFile as Integer, lRecLen as Long > Dim myAddrRec as tAddrRec > myFile = FreeFile > REM ***** Error occurs on next line. ***** > lRecLen = Len(myAddrRec) > REM Error message: "BASIC runtime error. Incorrect property value." > Open "D:\myAddresses.DAT" for random as myFile Len=lRecLen > With myAddrRec > iRecID = 1 > sRecType = "I" > sRecStatus = "A" > sLname = "Needles" > sFname= "Matt" > '. > '. > '. > sEmail = "[EMAIL PROTECTED]" > sNotes = "Test Record created on " & Now > End With > Put #myFile,1,myAddrRec > Close #myFile > End Sub > > Could someone please confirm these observations, and possibly why I'm > getting my error? > > TIA, > Matt Needles > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- PLEASE KEEP MESSAGES ON THE LIST. Documentation Co-Lead http://documentation.openoffice.org/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
