Click here to Skip to main content
15,911,646 members
Home / Discussions / C#
   

C#

 
AnswerRe: Alternative to Application.StartupPath Pin
Eddy Vluggen25-May-12 4:57
professionalEddy Vluggen25-May-12 4:57 
GeneralRe: Alternative to Application.StartupPath Pin
BobJanova25-May-12 5:51
BobJanova25-May-12 5:51 
GeneralRe: Alternative to Application.StartupPath Pin
Eddy Vluggen25-May-12 6:15
professionalEddy Vluggen25-May-12 6:15 
AnswerRe: Alternative to Application.StartupPath Pin
Richard MacCutchan25-May-12 4:58
mveRichard MacCutchan25-May-12 4:58 
AnswerRe: Alternative to Application.StartupPath Pin
BobJanova25-May-12 5:52
BobJanova25-May-12 5:52 
GeneralRe: Alternative to Application.StartupPath Pin
Eddy Vluggen25-May-12 6:18
professionalEddy Vluggen25-May-12 6:18 
GeneralRe: Alternative to Application.StartupPath Pin
BobJanova25-May-12 6:27
BobJanova25-May-12 6:27 
GeneralRe: Alternative to Application.StartupPath Pin
Eddy Vluggen25-May-12 6:32
professionalEddy Vluggen25-May-12 6:32 
GeneralRe: Alternative to Application.StartupPath Pin
MichCl25-May-12 7:23
MichCl25-May-12 7:23 
AnswerRe: Alternative to Application.StartupPath Pin
MichCl25-May-12 7:07
MichCl25-May-12 7:07 
AnswerRe: Alternative to Application.StartupPath Pin
Cracked-Down25-May-12 7:51
Cracked-Down25-May-12 7:51 
GeneralRe: Alternative to Application.StartupPath Pin
MichCl25-May-12 7:54
MichCl25-May-12 7:54 
GeneralRe: Alternative to Application.StartupPath Pin
Richard MacCutchan25-May-12 7:54
mveRichard MacCutchan25-May-12 7:54 
GeneralRe: Alternative to Application.StartupPath Pin
MichCl25-May-12 7:56
MichCl25-May-12 7:56 
GeneralRe: Alternative to Application.StartupPath Pin
Richard MacCutchan25-May-12 7:59
mveRichard MacCutchan25-May-12 7:59 
GeneralRe: Alternative to Application.StartupPath Pin
MichCl25-May-12 8:07
MichCl25-May-12 8:07 
AnswerRe: Alternative to Application.StartupPath Pin
MichCl25-May-12 8:01
MichCl25-May-12 8:01 
Questionerror adding 2 Uint16s stored in a List structure Pin
Terry Price25-May-12 0:58
Terry Price25-May-12 0:58 
AnswerRe: error adding 2 Uint16s stored in a List structure Pin
Richard MacCutchan25-May-12 1:05
mveRichard MacCutchan25-May-12 1:05 
Terry Price wrote:
Any ideas?

Yes, take the advice offered and use a cast:
C#
UInt16 toAdd, lhs, rhs;
 
for (int i = 0; i < a.data.Count; i++)
{
    lhs = (UInt16)a.data[i];
    rhs = (UInt16)b.data[i];
    toAdd = lhs + rhs;
}

BTW I don't know what this code is supposed to be doing but I don't think it is doing it right. You say you are trying to subtract something but then you add the same value twice into variable toAdd, so at the end of your loop toAdd will contain the sum of 2 * a.data[0] + 2 * a.data[1] ...
Programming is work, it isn't finger painting. Luc Pattyn

GeneralRe: error adding 2 Uint16s stored in a List structure Pin
harold aptroot25-May-12 1:14
harold aptroot25-May-12 1:14 
GeneralRe: error adding 2 Uint16s stored in a List structure Pin
Richard MacCutchan25-May-12 1:33
mveRichard MacCutchan25-May-12 1:33 
AnswerRe: error adding 2 Uint16s stored in a List structure Pin
Luc Pattyn25-May-12 2:17
sitebuilderLuc Pattyn25-May-12 2:17 
GeneralRe: error adding 2 Uint16s stored in a List structure Pin
Richard MacCutchan25-May-12 3:32
mveRichard MacCutchan25-May-12 3:32 
AnswerRe: error adding 2 Uint16s stored in a List structure Pin
Luc Pattyn25-May-12 2:21
sitebuilderLuc Pattyn25-May-12 2:21 
AnswerRe: error adding 2 Uint16s stored in a List structure Pin
BobJanova25-May-12 5:50
BobJanova25-May-12 5:50 

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.