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 3854658
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:39:24+00:00 2026-05-19T17:39:24+00:00

I have a quadratic equation struct, and I’d like to make it look nicer

  • 0

I have a quadratic equation struct, and I’d like to make it look nicer in the visual studio 2008 debugger. Here’s the struct:

struct QuadraticEquation
{
    float squareCoefficent; float linearCoefficent; float yIntersection; 
}

I’d like it to appear as a properly formatted equation in the debugger:

3.0x^2 - 1.3x + 6.5

Here’s the autoexp.dat preview script:

QuadraticEquation{
    preview
    (
        #if($c.squareCoefficent != 0.0f)
        (
            #($c.squareCoefficent, "x^2")
        )
        #if($c.linearCoefficent < 0.0f)
        (
            #(" - ", -$c.linearCoefficent, "x")            
        )
        #elif($c.linearCoefficent > 0.0f)
        (
            #(" + ", $c.linearCoefficent, "x")            
        )
        #if($c.yIntersection < 0.0f)
        (
            #(" - ", -$c.yIntersection)            
        )
        #elif($c.yIntersection > 0.0f)
        (
            #(" + ", $c.yIntersection)            
        )
    )
}

Pretty straight forward. But when I run the code, I get the following error message:

ERROR! Autoexp.dat:line(286) for 'QuadraticEquation': Failed to match ')' for preview/children rule

The line number corresponds to the second #if branch, that starts #if($c.linearCoefficent < 0.0f)...

If I remove everything except the square coefficent branch, it doesn’t error. If this means that I can’t have sequential #if blocks, how else could I do what I want here – without dropping into a dll?

  • 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-05-19T17:39:25+00:00Added an answer on May 19, 2026 at 5:39 pm

    I think you have to use nested #if‘s to achieve something like this. Check how std::complex<*> is done in the default autoexp.dat.

    This will take a lot of typing to cover all possible combinations. Do you really need that? Maybe displaying it simply as a struct is good enough for practical purposes.

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

Sidebar

Related Questions

I have a function to calculate the inverse of a quadratic equation. By default
I have quadratic equation 1/x = 1/(a-x) + 1/(3*a -x) I want to solve
i have following simpled algorithm for calculation roots of quadratic equation #include <iostream> #include
I need to find the quadratic equation term of a graph I have plotted
I have a quadratic bezier curve and I want to calculate the slope of
I have the following code (generates a quadratic function given the a, b, and
I have a vector drawing app where users can draw lines using multiple quadratic
Have a look at this picture alt text http://www.abbeylegal.com/downloads/2009-04-01/web%20part%20top%20line.jpg Does anyone know what css
I have a quadratic bezier curve described as (startX, startY) to (anchorX, anchorY) and
I have a quadratic bezier curve and I need the Y coordinate of a

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.