Any c# function similar to VFP evaluate( )

BenTam 1,781 Reputation points
2022-11-06T04:18:54.687+00:00

Dear All,

Is any c# function similar to VFP evaluate( )? For example, there is a textbox named txtClient

evaluate(txtClient.name+"_MethodName()") --> txtClient_MethodName( )

TIA

Developer technologies | C#
{count} votes

Accepted answer
  1. Sreeju Nair 12,666 Reputation points
    2022-11-06T04:54:17.88+00:00

    C# does not have an eval function to evaulate a string expression and give you its value. However there are ways to achieve this. Refer the following threads for reference.

    https://stackoverflow.com/questions/4629/how-can-i-evaluate-c-sharp-code-dynamically
    https://odetocode.com/articles/80.aspx
    https://learn.microsoft.com/en-us/answers/questions/404191/does-c-has-function-like-eval.html

    Hope this helps


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.