[AccessD] 32->64 bit
Stuart McLachlan
stuart at lexacorp.com.pg
Fri Nov 5 16:02:40 CDT 2021
Simple demo of using Type as a fcuntion paramter.
Type Person
Firstname As String
Lastname As String
DateofBirth As Date
Nationality As String
End Type
Function Makepers() As Person
Dim pers As Person
pers.Firstname = "Stuart"
pers.Lastname = "McLachlan"
pers.DateofBirth = "11 Feb 1949"
pers.Nationality = "New Zealand"
ShowPerson pers
End Function
Function ShowPerson(p As Person) As Long
MsgBox p.Firstname & " " & p.Lastname & ", " & Format$(p.DateofBirth, "YYYYMMDD") & "
- " & p.Nationality
End Function
On 5 Nov 2021 at 12:03, Bill Benson wrote:
> Types and Constants.
>
> For the record I have had treMENDOUS problems declaring my own types
> lately probably because I then try to use them as arguments in
> function declaratioms and don´t know what I am doing.
>
> On Fri, Nov 5, 2021 at 11:35 AM Arthur Fuller
> <fuller.artful at gmail.com> wrote:
>
> > Right. This doesn't quite help me what to do with this giant file,
> > so.
> > I have a few more basic questions to ask, because I don't know how
> > the
> > compiler works.
> > Suppose that I broke out all the Const declarations into a nodule
> > called Constants, and all the Type declarations into another module,
> > and all the Declarations into one or more modules, would the
> > compiler be able to figure it out
> >
> > On Thu, Nov 4, 2021 at 12:50 PM Jim Dettman <jimdettman at verizon.net>
> > wrote:
> >
> > >
> > >
> > > It´s best practice to always limit the scope, and they probably
> > > didn´t
> > use
> > > it outside of the module, so they marked it private.
> > >
> > >
> > >
> > > Jim.
> > >
> > >
> > >
> > > *From:* Arthur Fuller
> > > *Sent:* Thursday, November 4, 2021 12:35 PM
> > > *To:* Access Developers discussion and problem solving <
> > > accessd at databaseadvisors.com>
> > > *Cc:* Jim Dettman <jimdettman at verizon.net>
> > > *Subject:* Re: [AccessD] 32->64 bit
> > >
> > >
> > >
> > > Jim,
> > >
> > > I know that. I'm just a bit puzzled why Getz et.al. chose to set
> > > it up that way in all the BAS files in their book.
> > >
> > >
> > >
> > >
> > >
> > > On Thu, Nov 4, 2021 at 11:40 AM Jim Dettman via AccessD <
> > > accessd at databaseadvisors.com> wrote:
> > >
> > >
> > > That's something that pertains to scope, not 32/64 bit.
> > >
> > > Private just means that the declare can only be called from the
> > > module
> > > it's
> > > in. Public would be the opposite, where it can be called from
> > > anywhere.
> > >
> > > Here's a link that covers it:
> > >
> > >
> > >
> > https://docs.microsoft.com/en-us/office/vba/language/concepts/gettin
> > g-starte
> > > d/understanding-scope-and-visibility
> > >
> > > Jim.
> > >
> > > -----Original Message-----
> > > From: AccessD On Behalf Of Arthur Fuller
> > > Sent: Thursday, November 4, 2021 10:38 AM
> > > To: Access Developers discussion and problem solving
> > > <accessd at databaseadvisors.com>
> > > Subject: [AccessD] 32->64 bit
> > >
> > > This is more work than I had hoped. Also confusing. A bunch of the
> > > code
> > I'm
> > > trying to upgrade comes frm Access 2000 Developers Handbook (Getz,
> > > Liwin et. a.) All the code I gpt from there declares the API stuff
> > > like this:
> > >
> > > Private Declare Function xyz
> > >
> > > I don't understand the use of "Private" in this context.
> > >
> > > the Win32API_PtrSafe.txt file doesn't use the Private word.
> > > Instead the
> > >
> > > declarations look like this:
> > >
> > > #If VBA7 Then
> > > Declare PtrSafe Function SetTimer Lib "user32" (ByVal hWnd As
> > > LongPtr,
> > > ByVal nIDEvent As LongPtr, ByVal uElapse As Long, ByVal
> > > lpTimerFunc As LongPtr) As LongPtr
> > > #Else
> > > Declare Function SetTimer Lib "user32" (ByVal hWnd As Long,
> > > ByVal
> > > nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As
> > > Long) As
> > Long
> > > #End If
> > >
> > > --
> > > Arthur
> > > --
> > > AccessD mailing list
> > > AccessD at databaseadvisors.com
> > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > Website: http://www.databaseadvisors.com
> > >
> > > --
> > > AccessD mailing list
> > > AccessD at databaseadvisors.com
> > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > Website: http://www.databaseadvisors.com
> > >
> > >
> > >
> > >
> > > --
> > >
> > > Arthur
> > >
> > >
> > >
> >
> >
> > --
> > Arthur
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > https://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
More information about the AccessD
mailing list