Page 1 of 1
Splitting headache
Posted: Tue Aug 26, 2008 10:58 am
by jayshields
I've just spent over an hour trying to work out why Javascript refused to work with
Code: Select all
$msg .= 'There are not enough ingredients in stock to prepare your order, please
reduce the quantities of the following menu items:';
but would work with every other permutation under the sun! As soon as I found out this worked
Code: Select all
$msg .= 'There are not enough ingredients in stock to prepare your order, please reduce the quantities of the following menu items:';
I almost chucked my computer out of the window! I have debugged absolutely everything and it turns out it was the line break...
My head is killing now! Anyone else had a similar experience recently? Might make me feel better!
Re: Splitting headache
Posted: Tue Aug 26, 2008 11:04 am
by pickle
Not recently, but a couple years ago I had this problem. Now I know not to put line breaks in my quoted strings.
Re: Splitting headache
Posted: Tue Aug 26, 2008 11:42 am
by RobertGonzalez
At times like these I like to curse profusely at my computer then go eat (or drink).
Re: Splitting headache
Posted: Wed Aug 27, 2008 12:07 am
by califdon
I find that drinking is usually more effective.

Re: Splitting headache
Posted: Wed Aug 27, 2008 3:01 am
by swiftouch
Whenever I have a problem like this I call my congressman and complain because I KNOW they can fix the problem for me.
Re: Splitting headache
Posted: Wed Aug 27, 2008 10:30 am
by Bill H
I recall back in the days when I was programming in C for DOS. (Everyone else was programming for DOS too, as MS had not yet released Windows #1, and C++ had not yet been invented. I am quite old.) I had a place where the screen sometimes would go blank for about one second and then the program would resume normally. I debugged like crazy and could not find it. Weeks went by with no luck. I got a couple other programmers to look for it. No luck. It seemed to be doing no harm, but a full second of blank screen is a long time, and certainly something was going on.
It was me that finally found it, which saved me from having to advertise my stupidity until I was old enough to not mind advertising my stupidity.
I was telling a string input function to finish out an input by printing spaces. The variable was an unsigned integer, but I was not testing to be sure that no negative value ever reached the variable. We all know how an unsigned integer interprets a -1, don't we?
it required the technology of that time about one second to print 32,672 spaces to the screen. Blush.
Re: Splitting headache
Posted: Wed Aug 27, 2008 12:13 pm
by RobertGonzalez
Dude, that needs to be on the daily WTF. That was awesome.
Re: Splitting headache
Posted: Wed Aug 27, 2008 12:59 pm
by Bill H
I should mention, I joined AA about three years later.