dcsimg
Results 1 to 4 of 4

Thread: Converting a string to vb.net keyword

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2019
    Posts
    4

    Converting a string to vb.net keyword

    Can anyone tell me with certainty if it is possible to convert a string variable to Vb.Net Keyword or a mathematical function.

    For e.g. is it possible to convert a string "If", "Then", "Else", "End If" to a keyword If, Then, Else and End If

    Or a string "EXP" to function Exp

    Or a string "+" to an actual operator +

  2. #2
    Addicted Member Goggy's Avatar
    Join Date
    Oct 2017
    Posts
    144

    Re: Converting a string to vb.net keyword

    you will have to write the interperter yourself,

    an example of a math interperter can be found here https://www.codeproject.com/Articles...ath-Parser-NET
    Utterly useless, but always willing to help

    As a finishing touch god created the dutch

  3. #3
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    22,431

    Re: Converting a string to vb.net keyword

    For (most of) the mathematical stuff, try...

    Code:
    Dim dt As New DataTable
    MsgBox(dt.Compute("1 + 2 + 3 + 4 + 5", Nothing))

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2019
    Posts
    4

    Re: Converting a string to vb.net keyword

    [RESOLVED] Thanks folks!

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width