Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I box up a struct, yet maintain variable structure for GetType
    text
    copied!<p>First off, I'm using <a href="https://code.google.com/p/tweener-dotnet/" rel="nofollow">tweener-dotnet</a> for my tweening. This is where my issues are stemming from, and I'm not a skilled enough coder to change tweener into something more flexible.</p> <p>In my main namespace, I have a struct called Vitals that contains a couple integers and a string. In my main class inside that namespace, I have a variable called VitalSigns of the type Vitals (the struct), and I have no trouble in any of my main code adjusting VitalSigns.EKG_BPM or anything.</p> <p>The problem comes when I try to tween something within VitalSigns -- first off, the documentation in Tweener is pretty good, but it's lacking a single example of how to use it, so I spent hours trying to figure that out -- Tweener starts working through its processes, and it hangs up where it tries to <em>the object I told it to use (the struct)</em>.GetType().GetProperty(*the property I told it to look for, specifically EKG_BPM*). This returns a null value, which breaks a float.Parse a few lines down (line 194).</p> <p>I know it's not how I'm sending the info -- if I use a NumericUpDown and adjust its Value, I can get beyond this error and error out on line 215 (Tweener only works in floats, it seems, and breaks on Decimals or Int32s).</p> <p>I've searched for solutions, and the one I've found that seems to be the most promising is that I have to box up the value -- forgive me if I'm wrong, but they're saying that I create a new variable of the same type that I want to adjust, make that equal VitalSigns.EKG_BPM, adjust the new variable, then make EKG_BPM = the new variable -- and that seems like a totally valid option until I look into how Tweener functions.</p> <p>Tweener specifically looks for a variable contained within an object -- It wants VitalSigns.EKG_BPM and not tempEKG_BPM.</p> <p>So, I'm at a total loss on what to do.</p> <p>Oh, in case you want to see my code up close, here's a zip of my project: <a href="https://dl.dropboxusercontent.com/u/3145077/Vital%20Signs%20Monitor.zip" rel="nofollow">https://dl.dropboxusercontent.com/u/3145077/Vital%20Signs%20Monitor.zip</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload