![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Expert Programmer
|
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 |
|
|
|
|
|
#12 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
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.
|
|
|
|
|
|
#13 |
|
Expert Programmer
|
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 |
|
|
|
|
|
#14 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 893
Rep Power: 4
![]() |
Ah, so it wasn't really "BSSSSSS".
|
|
|
|
|
|
#15 |
|
Expert Programmer
|
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 |
|
|
|
|
|
#16 | ||
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Your pipevalidation is the same as:
if(s_mJobNumber.IndexOf('|') == -1) return false;Quote:
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
||
|
|
|
|
|
#17 |
|
Expert Programmer
|
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 |
|
|
|
|
|
#18 |
|
Expert Programmer
|
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 |
|
|
|
|
|
#19 | |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Quote:
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 |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|