473,396 Members | 2,024 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,396 software developers and data experts.

serious sub routine bug

Tim

Here is a description of my problem...

call mysub (5, 10)

sub mysub (valA, valB)
response.write valB
valA = valA - 1
response.write valB
end sub

this should print out 10 followed by 10.
it doesn't.
it prints 10 followed by 9.

it is taking the 1 off the wrong variable! HOW!
it is not a typo, I've got everyone in the office to check out my code, it
is a real genuine unbelievable bug.

is it known? is it fixable?
Tim
--

Jul 19 '05 #1
8 1759
Assuming that you've typed your code correctly, you never do any math
against valB. (No offence meant, but I'm having trouble taking this
question seriously - IF you've typed your code correctly, that is)

"Tim" <me@nottellingyou.com> wrote in message
news:Ov**************@TK2MSFTNGP10.phx.gbl...

Here is a description of my problem...

call mysub (5, 10)

sub mysub (valA, valB)
response.write valB
valA = valA - 1
response.write valB
end sub

this should print out 10 followed by 10.
it doesn't.
it prints 10 followed by 9.

it is taking the 1 off the wrong variable! HOW!
it is not a typo, I've got everyone in the office to check out my code, it
is a real genuine unbelievable bug.

is it known? is it fixable?
Tim
--

Jul 19 '05 #2
prints 1010 here.

IIS 5 win 2000 pro

Mike

"Tim" <me@nottellingyou.com> wrote in message
news:Ov**************@TK2MSFTNGP10.phx.gbl...

Here is a description of my problem...

call mysub (5, 10)

sub mysub (valA, valB)
response.write valB
valA = valA - 1
response.write valB
end sub

this should print out 10 followed by 10.
it doesn't.
it prints 10 followed by 9.

it is taking the 1 off the wrong variable! HOW!
it is not a typo, I've got everyone in the office to check out my code, it
is a real genuine unbelievable bug.

is it known? is it fixable?
Tim
--

Jul 19 '05 #3
Tim
I don't understand what you mean?

at least 4 people checked the code.

it is a bug.

"WIlliam Morris" <se**************@hotmail.com> wrote in message
news:bl************@ID-205671.news.uni-berlin.de...
Assuming that you've typed your code correctly, you never do any math
against valB. (No offence meant, but I'm having trouble taking this
question seriously - IF you've typed your code correctly, that is)

"Tim" <me@nottellingyou.com> wrote in message
news:Ov**************@TK2MSFTNGP10.phx.gbl...

Here is a description of my problem...

call mysub (5, 10)

sub mysub (valA, valB)
response.write valB
valA = valA - 1
response.write valB
end sub

this should print out 10 followed by 10.
it doesn't.
it prints 10 followed by 9.

it is taking the 1 off the wrong variable! HOW!
it is not a typo, I've got everyone in the office to check out my code, it is a real genuine unbelievable bug.

is it known? is it fixable?
Tim
--


Jul 19 '05 #4
I get expected results too. Copy and paste your exact code into a reply
here. Your sub would be the same if it were:

Sub mysub(valA, valB)
response.write valB
response.write valB
End Sub

There's something you're not telling us, or you transcribed your subroutine
wrong when you posted it here. Copy and paste it exactly as it is and post
it here.

Ray at work

"Tim" <me@nottellingyou.com> wrote in message
news:u1**************@TK2MSFTNGP12.phx.gbl...
I don't understand what you mean?

at least 4 people checked the code.

it is a bug.

"WIlliam Morris" <se**************@hotmail.com> wrote in message
news:bl************@ID-205671.news.uni-berlin.de...
Assuming that you've typed your code correctly, you never do any math
against valB. (No offence meant, but I'm having trouble taking this
question seriously - IF you've typed your code correctly, that is)

"Tim" <me@nottellingyou.com> wrote in message
news:Ov**************@TK2MSFTNGP10.phx.gbl...

Here is a description of my problem...

call mysub (5, 10)

sub mysub (valA, valB)
response.write valB
valA = valA - 1
response.write valB
end sub

this should print out 10 followed by 10.
it doesn't.
it prints 10 followed by 9.

it is taking the 1 off the wrong variable! HOW!
it is not a typo, I've got everyone in the office to check out my
code,
it is a real genuine unbelievable bug.

is it known? is it fixable?
Tim
--



Jul 19 '05 #5
Maybe it's a variable scoping problem. Some suggestions to experiment
with:

Try parameter names of pvalA and pvalB.

Try using Option Explicit toward the top of the page and dim all your
variables in the appropriate places.

I doubt this would make a difference but try using a function instead of
a sub.

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #6
It outputs 10 and 10 for me, just like it should. I pasted your code
into a page right out of the message.
--

Phillip Windell [CCNA, MVP, MCP]
pw******@wandtv.com
WAND-TV (ABC Affiliate)
www.wandtv.com

"Tim" <me@nottellingyou.com> wrote in message
news:Ov**************@TK2MSFTNGP10.phx.gbl...

Here is a description of my problem...

call mysub (5, 10)

sub mysub (valA, valB)
response.write valB
valA = valA - 1
response.write valB
end sub

this should print out 10 followed by 10.
it doesn't.
it prints 10 followed by 9.

it is taking the 1 off the wrong variable! HOW!
it is not a typo, I've got everyone in the office to check out my code, it is a real genuine unbelievable bug.

is it known? is it fixable?
Tim
--

Jul 19 '05 #7
Tim
this is an exact copy, the only difference is I have removed the rest of the
sub after the point it makes it's mistake

sub showline(thesize,textsize,rs)

response.write thesize
response.write textsize

textsize=textsize-1
adcolor="white"
textcolor="black"
textcolor2="black"

response.write thesize
response.write textsize

'there is more after this point, but the damage is already done.

end sub


"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:ec**************@TK2MSFTNGP09.phx.gbl...
I get expected results too. Copy and paste your exact code into a reply
here. Your sub would be the same if it were:

Sub mysub(valA, valB)
response.write valB
response.write valB
End Sub

There's something you're not telling us, or you transcribed your subroutine wrong when you posted it here. Copy and paste it exactly as it is and post it here.

Ray at work

"Tim" <me@nottellingyou.com> wrote in message
news:u1**************@TK2MSFTNGP12.phx.gbl...
I don't understand what you mean?

at least 4 people checked the code.

it is a bug.

"WIlliam Morris" <se**************@hotmail.com> wrote in message
news:bl************@ID-205671.news.uni-berlin.de...
Assuming that you've typed your code correctly, you never do any math
against valB. (No offence meant, but I'm having trouble taking this
question seriously - IF you've typed your code correctly, that is)

"Tim" <me@nottellingyou.com> wrote in message
news:Ov**************@TK2MSFTNGP10.phx.gbl...
>
> Here is a description of my problem...
>
> call mysub (5, 10)
>
> sub mysub (valA, valB)
> response.write valB
> valA = valA - 1
> response.write valB
> end sub
>
> this should print out 10 followed by 10.
> it doesn't.
> it prints 10 followed by 9.
>
> it is taking the 1 off the wrong variable! HOW!
> it is not a typo, I've got everyone in the office to check out my

code,
it
> is a real genuine unbelievable bug.
>
> is it known? is it fixable?
>
>
> Tim
>
>
> --
>
>
>



Jul 19 '05 #8
Okay, so what does this do for you?
<%
Call showline(1, 2, 0)

sub showline(thesize,textsize,rs)

response.write thesize
response.write textsize

textsize=textsize-1
response.write thesize
response.write textsize

'there is more after this point, but the damage is already done.

end sub
%>
It should return:
1211
What do you get?

Ray at work

"Tim" <me@nottellingyou.com> wrote in message
news:eE**************@TK2MSFTNGP10.phx.gbl...
this is an exact copy, the only difference is I have removed the rest of the sub after the point it makes it's mistake

sub showline(thesize,textsize,rs)

response.write thesize
response.write textsize

textsize=textsize-1
adcolor="white"
textcolor="black"
textcolor2="black"

response.write thesize
response.write textsize

'there is more after this point, but the damage is already done.

end sub

Jul 19 '05 #9

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

Similar topics

142
by: Herr Lucifer | last post by:
As the founder of .NET framework, Microsoft claims that it invention will be the next best platform for programming in a near future. Now it is 2005, ..NET is 5 years old, and can talk and walk for...
55
by: amanda992004 | last post by:
Excluding the factors of the brain capability, i.e I am not asking about this factor, if you are a single, aside from enjoying coding or debugging, how do you make time to eat properly, i.e...
7
by: Morgan | last post by:
I have read much posts on the argument but no one clearly says if this operation is possible or not. Simply I have a routine which reads from a text file some integer arrays (1 or 2D). The...
10
by: BBFrost | last post by:
We just recently moved one of our major c# apps from VS Net 2002 to VS Net 2003. At first things were looking ok, now problems are starting to appear. So far ... (1) ...
66
by: Cor | last post by:
Hi, I start a new thread about a discussion from yesterday (or for some of us this morning). It was a not so nice discussion about dynamically removing controls from a panel or what ever. It...
1
by: everymn | last post by:
Hi, Supposedly the Alter Routine privilege can be granted at the level of a single routine but I haven't been able to get that to work. I've tried it a number of different ways like: GRANT...
7
by: Bob Darlington | last post by:
I'm using the following routine to call UpdateDiary() - below: Private Sub Form_BeforeUpdate(Cancel As Integer) On Error GoTo Form_BeforeUpdate_Error Call UpdateDiary(Me!TenantCounter,...
3
by: Peter Webb | last post by:
When I started my current extremely graphics intensive project, I ignored advice in this ng to use the Paint method, and used the alternate CreateGraphics approach. I thought there were some good...
2
by: pvong | last post by:
I'm a newbie. I'm using VS2008 & VB.net I have a simple site and each page uses the same sub-routine. I copy and paste to each page and that's no big deal but that can get tiresome. I was...
1
by: Guy Macon | last post by:
Serious Security Flaw in Google Chrome: http://www.readwriteweb.com/archives/security_flaw_in_google_chrome.php -- Guy Macon <http://www.GuyMacon.com/>
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: 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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.