Results 1 to 3 of 3
  1. #1
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed

    [Tut]Data Conversions

    Conversions (data)

    Reference Guide: (come back here whenever you need to reference Ctypes)
    Here is a list of types of conversion types used in VB.net

    • CObj - Converts to Object Type
    • CChar - Converts to Char Type
    • CDate - Converts to Date Type
    • CString - Convert to String Type
    • CDbl - Converts to Double Type
    • CBool - Converts to Bool Type
    • CByte - Converts to Byte Type
    • CDec - Converts to Decimal Type
    • CShort - Converts to Short Type
    • CSng - Converts to Single Type
    • CInt - Converts to Integer Type
    • CLng - Converts to Long Type
    Example of Data Conversions

    As always, Open VB.net and follow along, if your interested in learning, then it's best to take the steps as you read them .

    VB.net data allows two ways of converting.

    Implicit
    (Automatic Conversions)

    Explicit
    (Manual Conversions)

    Implict Example:

    Create a New Module (Module1.vb = Module1)

    Add this to your Module

    Code:
    Imports System.Console
    Module Module1
    
    Sub Main()
    Dim dl=121.3121 as Double
    Dim i as Integer
    i=dl
    WriteLine("Integer value is" & i)
    End Sub
    
    End Module
    What does this do?

    When you run the code the result displayed is an integer value, in this case the value displayed is 121 instead of 121.3111

    Explicit Conversions

    Sometimes types cannot be implicitly converted, in which case you need to explicitly convert it
    (this type of conversion can also be called a "cast")

    CType function for conversion

    whenever we are uncertain of the conversion type we can use CType function.

    Here is an example:

    Code:
    Imports System.Console
    Module Module1
    
    Sub Main()
    Dim dl As Double
    dl = 121.3111
    Dim i As Integer
    i = CType(dl, i)
    WriteLine("Integer value is" & i)
    End Sub
    
    End Module
    You can obviously do this outside of a module (in the form, just remove the module , and add it to the part of the form you need it to trigger on)

    Next Tut will be File Extensions and Proper Conversions


     


     


     



    The Most complete application MPGH will ever offer - 68%




  2. The Following 2 Users Say Thank You to NextGen1 For This Useful Post:

    mnpeepno2 (01-27-2010),Zoom (01-27-2010)

  3. #2
    Zoom's Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    Your going on my 24/7 DDoS hit list.
    Posts
    8,552
    Reputation
    127
    Thanks
    5,970
    My Mood
    Happy
    Awesome! Thanks many ++++++++++++++++++++++++
    -Rest in peace leechers-

    Your PM box is 100% full.

  4. #3
    treeham's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Location
    heh. Turn around.
    Posts
    200
    Reputation
    10
    Thanks
    41
    My Mood
    Cynical
    I was making a browser and wondered what CType did, thanks bro.
    In Choob Language:
    also for all your info.. i didnt copy and paste shit.. coz i dont think anyone has realeased any source code for the New update of CA.. so sdfu..
    In English:
    I didn't copy and paste because no one has released what I need copy and paste
    Oh Choobs...

Similar Threads

  1. [TUT] Data on Images
    By Ugleh in forum Web Languages
    Replies: 9
    Last Post: 10-06-2009, 07:08 PM
  2. Forum Data Loss
    By Dave84311 in forum News & Announcements
    Replies: 9
    Last Post: 01-22-2006, 05:44 PM
  3. Tut. for k. gunz or J. gunz?
    By i eat trees in forum Hack Requests
    Replies: 0
    Last Post: 01-19-2006, 02:56 PM
  4. In-Depth Tut. to hacking in War Rock (Conc. to Dave)
    By fl0 in forum WarRock - International Hacks
    Replies: 15
    Last Post: 01-18-2006, 02:49 PM
  5. Tuts
    By Mukuro in forum Hack Requests
    Replies: 0
    Last Post: 01-09-2006, 04:54 PM