Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8948643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:02:50+00:00 2026-06-15T13:02:50+00:00

I am rewriting an existing template solution with scripting support to run as an

  • 0

I am rewriting an existing template solution with scripting support to run as an expression tree instead of interpreting the AST every execution and the logic has to work with existing scripts.

What I am trying to achieve right now is to create a solution to test for true.

Ex. strings that are null or empty is considered false as is 0 and any decimal value with an absolute value below 0.0001. “true” and “false” are what they say, case insensitive, and the string “null” is false.

The only input types valid are float, int, string and bool.

Any solution that can be worked into an expression tree to be compiled is valid and I already have an existing method to test an object but cannot find any good example to call an external method.

Every example either works on constant values or accepts no arguments.

Update

I am building the tree using “Expression.ABC” methods, but are having a problem funding a way to switch over the type of the result (string, int, float) of an expression tree.

Current syntax stores everything as strings and parses to int and float depending on the operation, returning a default value if it fails.

Its built to be failsafe and always succeed to generate the result, even when supplied with bad syntax in the template.

Update

Example (not 100 % accurate but to exemplify the current interpreter)

string Evaluate(Expr e) {
    switch(Expr.Type) {
        case "istrue":
            ExprValue value = Evaluate(Expr.Child);
            switch(value.Type) {
                case "String":
                    if(String.IsNullOrWhiteSpace(value.ToString()) || value.ToString().ToLower() == "false" || value.ToString().ToLower() == "null" || value.ToInt() == 0) return false;

                case "Int":
                    return value.ToInt() != 0;
                case "Float":
            }
    }
}

*Update * Changed title

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:02:51+00:00Added an answer on June 15, 2026 at 1:02 pm

    The solution was to change the design.

    My problem was that I was trying to do my cast at the wrong time, at runtime, but expression tree cannot handle that in a good way.

    I redesigned the parser completely to have strongly typed methods and variables and explicit casts and that proved to be much easier to convert to an expression tree.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm rewriting an existing app for Honeycomb and I've run into a problem. In
I am rewriting the existing C++ application and adapting it for Android environment. In
I'm currently rewriting some existing technologies that were once using RSA Security's libraries into
I've recently refactored an existing CodeIgniter application to use url segments instead of query
I am developing a simple pdf reader rewriting an existing example. My app has
I'm going to start a new project - rewriting an existing system (PHP +
I'm rewriting some existing code in a setting where recursive calls are not easily
I am currently rewriting an already existing application using the Backbone.js Marionette framework. The
I am new to python object oriented and I am rewriting my existing application
I'm rewriting some existing code from Python to Ruby, and I've across a strange

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.