Results 1 to 8 of 8

Thread: [RESOLVED] [2005] Create Custom type

Threaded View

  1. #1

    Thread Starter
    Frenzied Member bmahler's Avatar
    Join Date
    Oct 2005
    Location
    Somewhere just west of the Atlantic
    Posts
    1,568

    Resolved [RESOLVED] [2005] Create Custom type

    Ok Here is my situation, I am writing a class that is used to convert between various GPS Coordinate Systems, To do this, the use can select a Datum which changes 2 values that are used in the calcualtions.
    ie
    Datum
    Name = "NAD83/WGS84 (Global)"
    a = 6378137
    b = 6353752.3142
    etc...
    What I have now is a structure that is defined as so
    VB Code:
    1. Public Structure Datum
    2.         Dim Name As String
    3.         Dim a As Double
    4.         Dim b As Double
    5.     End Structure

    what I am wondering is this, Is it possible to set up a custom type of sorts with 3 values, (name, a and b) so that I could do something like this

    VB Code:
    1. Public Property Datum() as DatumType
    2.         Get
    3.             Return DatumType.Name
    4.         End Get
    5.         Set(ByVal value As Double)
    6.             DatumType.Name = value
    7.         End Set
    8.     End Property

    Essentially what I want to happen is that when you go to set the property when using this class and you create a new instance, I want the Datum Property to give you a list of specific items that you can pick from that will then set the values of a anb b in the class

    VB Code:
    1. Dim gps As New ConvertGPS
    2. gps.Datum = 'have this show a predefined list of my datums to set the property

    I hope that I have been clear about this and thank you for any help
    Last edited by bmahler; Oct 25th, 2006 at 12:37 PM.
    Boooya
    • Visual Studio 2008 Professional
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • Don't forget to rate helpful posts!
    • If you're question was answered please mark your thread [Resolved]


    Code Contributions:
    PHP
    PHP Image Gallery v1.0PHP Image Gallery v2.0
    VB 2005
    Find Computers on a networkSimple License EncryptionSQL Server Database Access dllUse Reflection to Return Crystal ReportDocumentSilently Print PDFGeneric Xml Serailizer


    Useful Links: (more to come)
    MSDN (The first and foremost)MSDN Design Guidelines API Reference • Inno Setup CompilerInno Setup PreprocessorISTool - Fairly easy to use GUI for creating inno setup projects • Connection StringsNAnt -Automated BuildsCruise Control .NET - Frontend for automated builds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width