473,378 Members | 1,152 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

My blindness or php bug

The problem is that some functioning (I thought) code has stopped working:

$n = @odbc_num_rows($res);
$debug .= "<br>isset(n) " . $code . "=" . isset($n) . ";<br>";
$debug .= "<br>ncode " . $code . "=$ncode;<br>";
$debug .= "<br>n " . $code . "=$n;<br>";
switch ($ncode) {
case -2: /* 0 or 1 */
if(!isset($n) || (($n!=0) && ($n!=1))) {
$debug .= "<br>-2 " . $code . "=-2;<br>";
$myerr = TRUE;
$mymsg .= $code . " " . $msg . "<br><br>";
}
break;
case -1: break; /* don't care */
case 0: /* exactly 0 *\
if(!isset($n) || ($n!=0)) {
$debug .= "<br>0 " . $code . "=0;<br>";
$myerr = TRUE;
$mymsg .= $code . " " . $msg . "<br><br>";
}
break;
case 1: /* exactly one */
if(!isset($n) || ($n!=1)) {
$debug .= "<br>1 " . $code . "=1;<br>";
$myerr = TRUE;
$mymsg .= $code . " " . $msg . "<br><br>";
}
break;
case 2: /* at least one */
if(!isset($n) || ($n<1)) {
$debug .= "<br>2 " . $code . "=2;<br>";
$myerr = TRUE;
$mymsg .= $code . " " . $msg . "<br><br>";
}
break;
}

gives the following output:

isset(n) V ID=1;

ncode V ID=0;

n V ID=0;

1 V ID=1;

myerr=1; mymsg=V ID res-03 is already known id

which indicates case 1 was executed when case 0 was called for.
Sep 26 '05 #1
3 1148
On Mon, 26 Sep 2005 15:11:10 -0400, Bob Stearns
<rs**********@charter.net> wrote:
The problem is that some functioning (I thought) code has stopped working: case 0: /* exactly 0 *\ which indicates case 1 was executed when case 0 was called for.


incorrect end of comment

--
Regards, Paul Herber, Sandrila Ltd. http://www.pherber.com/
SanDriLa - SDL/MSC/TTCN/UML2 application for Visio http://www.sandrila.co.uk/
Sep 26 '05 #2
Paul Herber wrote:
On Mon, 26 Sep 2005 15:11:10 -0400, Bob Stearns
<rs**********@charter.net> wrote:

The problem is that some functioning (I thought) code has stopped working:


case 0: /* exactly 0 *\


which indicates case 1 was executed when case 0 was called for.

incorrect end of comment

Thank you! I thought it was something of that order, but I couldn't see
it. Occasionally fresh eyes are necessary.
Sep 26 '05 #3
In article <8k******************@fe02.lga>,
Bob Stearns <rs**********@charter.net> wrote:
Paul Herber wrote:
On Mon, 26 Sep 2005 15:11:10 -0400, Bob Stearns
<rs**********@charter.net> wrote:

The problem is that some functioning (I thought) code has stopped working:


case 0: /* exactly 0 *\


which indicates case 1 was executed when case 0 was called for.

incorrect end of comment

Thank you! I thought it was something of that order, but I couldn't see
it. Occasionally fresh eyes are necessary.


A color coding editor has be come quite a comfort to me in my old age.
You might try vim in php mode. I don't know if emacs also does color
coding. Or the Zend editor.

--
DeeDee, don't press that button! DeeDee! NO! Dee...

Sep 26 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
4
by: Alexander Schmolck | last post by:
Sorry if I missed something obvious, but how do you do this more intelligently? def escape(s): return re.sub(r'()', r'\ \1', s).replace('\\ ', '\\') 'as
198
by: Sridhar R | last post by:
>From technical point of view, I could not understand the the reasoning behind using Java in major companies. Sure that Python, is used in some, but still Java is considered as a sure-job...
2
by: Chris | last post by:
Hi, I'm trying to extract data from objects that contain xml that fits a third party schema with it's own root namespace. I've added a namespace manager that seemed to work most of the time but...
5
by: Tim Marshall | last post by:
In a recent review of someone's web site on a hobby forum, one poster mentioned the difficulties for folks with some forms of colour blindness to see some of the text of the web site in question. ...
31
by: damacy | last post by:
hi, there. i have a problem writing a program which can obtain ip addresses of machines running in the same local network. say, there are 4 machines present in the network; , , and and if i...
59
by: Umesh | last post by:
i wrote the following program to calculate factorial: #include<stdio.h> #include<iostream.h> void main() { int i,n; long int p=1; // or long double p=1; for exponential result which I don't...
12
by: xkenneth | last post by:
All, I apologize if this is a commonly asked question, but I didn't find anything that answered my question while searching. So what I have right now is a few packages that contain some...
7
by: Steve Swift | last post by:
Imagine you're in a game where your opponent picks the background colour of your webpage, in #RRGGBB format, and you have to pick the foreground text colour that contrasts best with their choice. I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.