Click here to Skip to main content
15,913,854 members
Home / Discussions / C#
   

C#

 
GeneralRe: JPEG image processing with C# Pin
Christian Graus16-Jan-05 11:35
protectorChristian Graus16-Jan-05 11:35 
GeneralRe: JPEG image processing with C# Pin
memoboy16-Jan-05 10:01
memoboy16-Jan-05 10:01 
GeneralRe: JPEG image processing with C# Pin
Christian Graus16-Jan-05 11:37
protectorChristian Graus16-Jan-05 11:37 
GeneralRe: JPEG image processing with C# Pin
Heath Stewart17-Jan-05 6:05
protectorHeath Stewart17-Jan-05 6:05 
GeneralTransfer Files Pin
Sakkijha16-Jan-05 6:39
Sakkijha16-Jan-05 6:39 
GeneralRe: Transfer Files Pin
Heath Stewart16-Jan-05 9:08
protectorHeath Stewart16-Jan-05 9:08 
GeneralObjects Performing Maths Functions Pin
Wayne Phipps16-Jan-05 4:42
Wayne Phipps16-Jan-05 4:42 
GeneralRe: Objects Performing Maths Functions Pin
Heath Stewart16-Jan-05 6:26
protectorHeath Stewart16-Jan-05 6:26 
Using a DataTable is rather inefficient with lots of overhead you don't need for a simple state machine and what could be done using simple state variables. Store your result in a variable just like you do for your controls you dropped onto the form in the designer. Read the operands from the form, calculate, and store the result in the variable. If you want to remember all the results use a growable list like ArrayList or Stack. A stack is what your more advanced calculators use to store previous results, and stacks are what are typically used by calculators to evaluate expressions. You can find lots of information on the web about evaluating expressions to perform calculations.

Even if you want to stick with using a DataTable add a column for metadata about the operands and/or operators you have stored in the DataRows. You could, for example, push the result of a calculation into a new DataRow with information that states whether the data is an operand, operator, or result.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralWindows logon Pin
WillemM16-Jan-05 3:03
WillemM16-Jan-05 3:03 
GeneralRe: Windows logon Pin
Heath Stewart16-Jan-05 6:20
protectorHeath Stewart16-Jan-05 6:20 
GeneralRe: Windows logon Pin
WillemM16-Jan-05 6:41
WillemM16-Jan-05 6:41 
GeneralRe: Windows logon Pin
Heath Stewart16-Jan-05 9:00
protectorHeath Stewart16-Jan-05 9:00 
GeneralRe: Windows logon Pin
WillemM16-Jan-05 20:21
WillemM16-Jan-05 20:21 
GeneralMove control at runtime Pin
M4tt16-Jan-05 2:56
M4tt16-Jan-05 2:56 
GeneralRe: Move control at runtime Pin
Mazdak16-Jan-05 6:10
Mazdak16-Jan-05 6:10 
Questionhow to create a (splitter?)bar as in outlook 2003... Pin
just_starting16-Jan-05 2:45
just_starting16-Jan-05 2:45 
AnswerRe: how to create a (splitter?)bar as in outlook 2003... Pin
Heath Stewart16-Jan-05 9:09
protectorHeath Stewart16-Jan-05 9:09 
GeneralRe: how to create a (splitter?)bar as in outlook 2003... Pin
just_starting17-Jan-05 4:45
just_starting17-Jan-05 4:45 
GeneralRe: how to create a (splitter?)bar as in outlook 2003... Pin
Heath Stewart17-Jan-05 5:57
protectorHeath Stewart17-Jan-05 5:57 
AnswerRe: how to create a (splitter?)bar as in outlook 2003... Pin
Craig G Fraser17-Jan-05 23:42
Craig G Fraser17-Jan-05 23:42 
GeneralIP Input Custom Control Pin
Hercules0116-Jan-05 1:26
Hercules0116-Jan-05 1:26 
GeneralRe: IP Input Custom Control Pin
Judah Gabriel Himango16-Jan-05 12:33
sponsorJudah Gabriel Himango16-Jan-05 12:33 
GeneralNetworkStream Pin
alexiev_nikolay15-Jan-05 23:58
alexiev_nikolay15-Jan-05 23:58 
GeneralRe: NetworkStream Pin
Heath Stewart16-Jan-05 9:42
protectorHeath Stewart16-Jan-05 9:42 
GeneralShortcut Keys Pin
egyseiko15-Jan-05 22:49
egyseiko15-Jan-05 22:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.