Click here to Skip to main content
16,005,178 members
Home / Discussions / C#
   

C#

 
GeneralRe: Access to the VGA/DVI port Pin
Bobby Hang3-Jun-09 2:19
Bobby Hang3-Jun-09 2:19 
QuestionNeed to time stamp the last time a file was considered good. [modified] Pin
Lecutus120-May-09 11:49
Lecutus120-May-09 11:49 
AnswerRe: Need to time stamp the last time a file was considered good. Pin
DaveyM6920-May-09 11:56
professionalDaveyM6920-May-09 11:56 
GeneralRe: Need to time stamp the last time a file was considered good. Pin
Lecutus121-May-09 4:17
Lecutus121-May-09 4:17 
Answerread my sig! Pin
Luc Pattyn20-May-09 12:35
sitebuilderLuc Pattyn20-May-09 12:35 
GeneralRe: read my sig! Pin
Lecutus121-May-09 4:16
Lecutus121-May-09 4:16 
GeneralRe: read my sig! Pin
Luc Pattyn21-May-09 4:26
sitebuilderLuc Pattyn21-May-09 4:26 
AnswerRe: Need to time stamp the last time a file was considered good. Pin
Luc Pattyn21-May-09 4:36
sitebuilderLuc Pattyn21-May-09 4:36 
Hi,

the code shown has only one way to modify last_Time. If you are not satisfied with the value of last_Time, AFAIK there are only two possibilities:
1. Check(1) is called where Check(0) was intended, causing the block with "ast_Time=now" to execute.
2. More Check(1) calls are performed, maybe entirely unrelated to the ones you are looking at, but since last_Time is static, they all share that one variable.

Suggestions:
1. don't use static variables unless you really need them; when they just seem the easy way to solve something, they will come back at you later on. A better way would be to make them non-static and instantiate your class once for every independent series of checks you want to perform (you already have to instantiate since Check itself is not static).
2. choose better names for your variables, especially the class members (last_Time) and the method parameters (decision). Also use boolean type if only two values are allowed, use an enum when more than two non-counting values are acceptable.

Instead of if(decision==1) ... I would write if (packetOK) ... or if (packetState==PacketState.Good)...

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

GeneralRe: Need to time stamp the last time a file was considered good. Pin
Lecutus122-May-09 3:34
Lecutus122-May-09 3:34 
QuestionLeftover Cache? Pin
gmhanna20-May-09 10:10
gmhanna20-May-09 10:10 
QuestionProblem in datagridtextbox column Pin
Shuaib wasif khan20-May-09 8:22
Shuaib wasif khan20-May-09 8:22 
AnswerRe: Problem in datagridtextbox column Pin
Henry Minute21-May-09 0:14
Henry Minute21-May-09 0:14 
QuestionAdd-In Pin
su_penguin20-May-09 6:24
su_penguin20-May-09 6:24 
AnswerRe: Add-In Pin
molesworth20-May-09 6:36
molesworth20-May-09 6:36 
GeneralRe: Add-In Pin
su_penguin20-May-09 7:07
su_penguin20-May-09 7:07 
GeneralRe: Add-In Pin
molesworth20-May-09 9:31
molesworth20-May-09 9:31 
QuestionDataBinding in ComboBox Pin
LiranViper20-May-09 6:20
LiranViper20-May-09 6:20 
AnswerRe: DataBinding in ComboBox Pin
Ian McCaul20-May-09 6:46
Ian McCaul20-May-09 6:46 
GeneralRe: DataBinding in ComboBox Pin
LiranViper20-May-09 22:37
LiranViper20-May-09 22:37 
Questiontreeview checkboxes Pin
ehsan salehi20-May-09 6:04
ehsan salehi20-May-09 6:04 
Questionremoting annoying Exception {"Found two different objects associated with the same URI, '/999013af_72e3_42b1_affa_43766d7f541f/Chat'."} [modified] Pin
michael@cohen20-May-09 5:57
michael@cohen20-May-09 5:57 
QuestionCrazy error Pin
Jonathan Harker20-May-09 5:31
Jonathan Harker20-May-09 5:31 
AnswerRe: Crazy error Pin
molesworth20-May-09 5:51
molesworth20-May-09 5:51 
AnswerRe: Crazy error Pin
DavidRRR20-May-09 5:54
DavidRRR20-May-09 5:54 
AnswerRe: Crazy error Pin
Dave Kreskowiak20-May-09 6:03
mveDave Kreskowiak20-May-09 6:03 

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.