Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Dynamic statements / simple parser (VB.NET)

Dynamic statements / simple parser (VB.NET)

Scheduled Pinned Locked Moved Visual Basic
questioncsharpwinformsjson
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MrBean
    wrote on last edited by
    #1

    I'm writing an Windows Forms VB.NET application where the user can type in some kind of compare evaluator. Example : {cost} > 10000 and {itemgroup} = 'A01' My app. will take the entered text and evaluate it against in-memory data. The values tags ( {cost}, {itemgroup}, etc.) are replaced with the proper values by my app before evaluation/parsing... so my question is : Is there a simple way of parsing or evaluating a dynamic statement in a string ? Something what would work like this : dim strStatement as string = " 780 > 10000 and 'B54' = 'A01' " if EvaluateStatement(strStatement) then ' Do some stuff.. else ' Do some other stuff.. end if Do I need to code my own evaluator from scratch or is there a shortcut or code I can use... maybe a 3rd party control ? Any advice ? TIA :)

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups