Sr. Web Developer
mediabistro.com
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

Using .NET Assembly (Interoperability with COM) in PHP
Creating a Assembly
Open Visual Studio.Net and create a new class library project, which we shall call "phpclas". Click OK.
New Project window
In the code window for class1 (class1.vb), type the following:
Namespace HealthRecord
    Public Class patient
        Private m_lmp As Date
        Public Property lmp()
            Get
                Return Format(m_lmp, "D")
            End Get
            Set(ByVal Value)
                m_lmp = Value
            End Set
        End Property
        Public ReadOnly Property edd()
            Get
              'EDD is 280 days from LMP
              Return Format(DateAdd(DateInterval.Day, 280, m_lmp), "D")
            End Get
        End Property
    End Class
End Namespace
This VB.NET code shall calculate the EDD (Estimated Delivery Date) from the specified LMP (Last Menstrual Period) date for any patient, to implement this we have created a namespace HealthRecord and a public class patient with two public property lmp and edd, edd is a readonly property, which is calculated from lmp which could be set and also read.
We have used format function to format the date variable to human readable format; also we have used dateadd function to calculate the edd, which is 280 days from the lmp.
[ Next Page ]

[Page 1]  [Page 2]  


Comments:
How to Distribute the final TLB file to PC'sRajeev12/16/04 08:13
RE: So What ?Spiff02/03/04 14:18
RE: What about linux platform?Joao Paulo M. Fischer12/10/02 23:47
RE: What about linux platform?Jason11/11/02 08:42
RE: So What ?James Moore11/07/02 15:00
What about linux platform?sreekumar menon11/07/02 04:55
So What ?Sacnar "Delifisek" Saran11/06/02 11:26
Very practical and simpleSpencer Müller Diniz11/06/02 07:15
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.