Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 20th, 2006, 11:11 AM   #11
Kilo
Expert Programmer
 
Kilo's Avatar
 
Join Date: Nov 2005
Location: In Pink Clam?
Posts: 542
Rep Power: 0 Kilo is an unknown quantity at this point
Send a message via AIM to Kilo
lol i apologize to everyone, i was not bitching/complaing at all about a slow response. I was pointing out that i have never seen that before... so again i apologize.


As for my code, im schocked i didn't attempt this before.

this is code code using that function
[php]
if(!PipeValidation(s_mJobNumber)) return false;
if(!PipeValidation(s_mJobName)) return false;
if(!PipeValidation(s_mDataFile)) return false;
if(!PipeValidation(s_mImageRef)) return false;
if(!PipeValidation(s_mProgrammer)) return false;
if(!PipeValidation(s_mComments)) return false;
if(!PipeValidation(s_mSamples)) return false;
if(!PipeValidation(s_mDIF)) return false;
if(!PipeValidation(s_mSampleQty)) return false;
if(!PipeValidation(s_mPaperStock)) return false;
if(!PipeValidation(s_mStockSize)) return false;
[/php]

when it passed s_mComments... its value was null

thank you everyone for your time.
__________________
"When in Rome, Do as the Romans Do"
"Beauty is in the eye of the BEER holder"
"Save your breath your going to need it for your blow up doll later"

SearchLores.org
Kilo is offline   Reply With Quote
Old Apr 20th, 2006, 11:18 AM   #12
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Uh, that piece of code doesn't help either. Just debug the system, seeing s_mComments on your variable watch list and observe what happens.
Arevos is offline   Reply With Quote
Old Apr 20th, 2006, 1:06 PM   #13
Kilo
Expert Programmer
 
Kilo's Avatar
 
Join Date: Nov 2005
Location: In Pink Clam?
Posts: 542
Rep Power: 0 Kilo is an unknown quantity at this point
Send a message via AIM to Kilo
i was just showing you were i caught my error! At the moment i was passing a null value of a variale called s_mComments to the PipeValidation routine.
__________________
"When in Rome, Do as the Romans Do"
"Beauty is in the eye of the BEER holder"
"Save your breath your going to need it for your blow up doll later"

SearchLores.org
Kilo is offline   Reply With Quote
Old Apr 20th, 2006, 1:25 PM   #14
The Dark
Expert Programmer
 
Join Date: Jun 2005
Posts: 893
Rep Power: 4 The Dark is on a distinguished road
Ah, so it wasn't really "BSSSSSS".
The Dark is offline   Reply With Quote
Old Apr 20th, 2006, 1:37 PM   #15
Kilo
Expert Programmer
 
Kilo's Avatar
 
Join Date: Nov 2005
Location: In Pink Clam?
Posts: 542
Rep Power: 0 Kilo is an unknown quantity at this point
Send a message via AIM to Kilo
lmao.... well at that moment in my mind, yes it was. But calming down, reading it over and over again... then deciding to "step through" the program with watches... pretty simple in the end and no not "BSSSSSSS"
__________________
"When in Rome, Do as the Romans Do"
"Beauty is in the eye of the BEER holder"
"Save your breath your going to need it for your blow up doll later"

SearchLores.org
Kilo is offline   Reply With Quote
Old Apr 20th, 2006, 1:56 PM   #16
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
Your pipevalidation is the same as:
if(s_mJobNumber.IndexOf('|') == -1) return false;

Quote:
Originally Posted by nnxion
Quote:
Originally Posted by Pedja
@nnxion
I think that the problem might be passing a null value to the function.
Nah, I don't think he's that stupid.
OMG, you were!
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Old Apr 20th, 2006, 2:21 PM   #17
Kilo
Expert Programmer
 
Kilo's Avatar
 
Join Date: Nov 2005
Location: In Pink Clam?
Posts: 542
Rep Power: 0 Kilo is an unknown quantity at this point
Send a message via AIM to Kilo
personally no i wasn't... we have 3 people (including myself) working on this project. My big problem was i was to stupid to investigate the problem instead of got tired of the error and posted.

IndexOf... so that how that works? that simple huh... i love C# on one hand but then again i don't like things so easy.... grrr
__________________
"When in Rome, Do as the Romans Do"
"Beauty is in the eye of the BEER holder"
"Save your breath your going to need it for your blow up doll later"

SearchLores.org
Kilo is offline   Reply With Quote
Old Apr 20th, 2006, 2:23 PM   #18
Kilo
Expert Programmer
 
Kilo's Avatar
 
Join Date: Nov 2005
Location: In Pink Clam?
Posts: 542
Rep Power: 0 Kilo is an unknown quantity at this point
Send a message via AIM to Kilo
ok yea...

if(s_mJobNumber.IndexOf('|') == -1) return false;

that didn't work at all! i replaced them.. then tested... didn't work
__________________
"When in Rome, Do as the Romans Do"
"Beauty is in the eye of the BEER holder"
"Save your breath your going to need it for your blow up doll later"

SearchLores.org
Kilo is offline   Reply With Quote
Old Apr 20th, 2006, 5:19 PM   #19
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
Quote:
Originally Posted by Kilo
ok yea...

if(s_mJobNumber.IndexOf('|') == -1) return false;

that didn't work at all! i replaced them.. then tested... didn't work
Yeah my mistake though easily tested. One quick look should have told you.
This should be it:
if(s_mComments.IndexOf('|') != -1)

Which can be tested like:
[php]using System;

class MainClass
{
private static bool PipeValidation(string pipeVal)
{
for(int i=0; i<pipeVal.Length; i++)
{
if(pipeVal[i] == '|')
{
return false;
}
}
return true;
}

public static int Main(string[] args)
{
string s_mProgrammer = "kilo_noob";
string s_mComments = "lol|pup";

// PipeValidation comments
if(!PipeValidation(s_mComments))
System.Console.WriteLine("PipeValidation s_mComments false");
else
System.Console.WriteLine("PipeValidation s_mComments true");

// PipeValidation programmer
if(!PipeValidation(s_mProgrammer))
System.Console.WriteLine("PipeValidation s_mProgrammer false");
else
System.Console.WriteLine("PipeValidation s_mComments true");

// IndexOf comments
if(s_mComments.IndexOf('|') != -1)
System.Console.WriteLine("IndexOf s_mComments false");
else
System.Console.WriteLine("IndexOf s_mComments true");

// IndexOf programmer
if(s_mProgrammer.IndexOf('|') != -1)
System.Console.WriteLine("IndexOf s_mProgrammer false");
else
System.Console.WriteLine("IndexOf s_mProgrammer true");

return 0;
}
}[/php]
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:50 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC