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

finding return value in fuction - debugging

guy
If I have a break point at the end of a function, how do I determine what
the return value of the function is if it's not in a local variable - for
e.g. one function is returning a call to another function:

bool func1()
{
return func2();
}

Thanks
Nov 16 '05 #1
4 1243
Well, add func1() or funct2() to the Watch window. It
would show up over there, if func1() returns true or false

HTH

Kumar
-----Original Message-----
If I have a break point at the end of a function, how do I determine whatthe return value of the function is if it's not in a local variable - fore.g. one function is returning a call to another function:

bool func1()
{
return func2();
}

Thanks
.

Nov 16 '05 #2
bool func1()
{
bool bRetVal = func2();
return bRetVal;
}

More verbose, I know. But it is a good idea to write code with your
debugging sessions in mind.

Adam.
--
===========================
Adam Benson
Omnibus Systems,
Leics. UK
Email : Ad*********@NOSPAM.omnibus.co.uk

"guy" <wi*********@hotmail.com> wrote in message
news:O7**************@TK2MSFTNGP11.phx.gbl...
If I have a break point at the end of a function, how do I determine what
the return value of the function is if it's not in a local variable - for
e.g. one function is returning a call to another function:

bool func1()
{
return func2();
}

Thanks

Nov 16 '05 #3
guy
True Adam... but every now and then you find yourself in a situation where
you've forgotten to do that you you want to know what the return value's
going to be...

"Adam Benson" <Ad*********@omnibus.NOSPAM.co.uk> wrote in message
news:On*************@TK2MSFTNGP11.phx.gbl...
bool func1()
{
bool bRetVal = func2();
return bRetVal;
}

More verbose, I know. But it is a good idea to write code with your
debugging sessions in mind.

Adam.
--
===========================
Adam Benson
Omnibus Systems,
Leics. UK
Email : Ad*********@NOSPAM.omnibus.co.uk

"guy" <wi*********@hotmail.com> wrote in message
news:O7**************@TK2MSFTNGP11.phx.gbl...
If I have a break point at the end of a function, how do I determine what
the return value of the function is if it's not in a local variable - for
e.g. one function is returning a call to another function:

bool func1()
{
return func2();
}

Thanks


Nov 16 '05 #4
guy
I thought I'd tried that without any luck...? Perhaps I was mistaken.

Putting func2() in the watch window: does that evaluate the function as
well? if so that would cause cause if func2() for example incremented a
counter. then your debugger would be altering the values in app...

"Kumar Reddi" <Ku********@REMOVETHIS.GMAIL.COM> wrote in message
news:4c****************************@phx.gbl...
Well, add func1() or funct2() to the Watch window. It
would show up over there, if func1() returns true or false

HTH

Kumar
-----Original Message-----
If I have a break point at the end of a function, how do

I determine what
the return value of the function is if it's not in a

local variable - for
e.g. one function is returning a call to another function:

bool func1()
{
return func2();
}

Thanks
.

Nov 16 '05 #5

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

Similar topics

6
by: Lupe | last post by:
hi, if someone can help me I would be grateful when I do def function kjklj llklç return variableA, variableB
27
by: Maximus | last post by:
Hi, I was just wondering, is it good to use return without arguments in a void function as following: void SetMapLayer() { if( !Map ) return; layer = LAYER_MAP; }
4
by: Jerry Orr | last post by:
I'm writing a simple JNI C++ function on a z/OS 1.4 system. I am attempting to rename a dataset; however, when I use the rename() function, I get a return code of -1. All of the return codes listed...
7
by: ralphNOSPAM | last post by:
Is there a PHP script that can find unused variables? I'd like to 'clean up' my scripts. Thanks...
1
by: bdt513 | last post by:
I am trying to extract the values from a query using VBA. Specifically, I want to concatenate all the values of the "rosEmail" field from query "qselRosterEmailList" into one string (strEmails). I...
2
by: Ori :) | last post by:
I am writing an application to retrieve appointments from Outlook, I have the appointment items sorted by "Start" field and now I want to find the first record which's "Start" value is later than...
2
by: ElkGroveR | last post by:
Hi there! I'm using PHP to create a simple, dynamic MySQL SELECT query. The user chooses a selection from a HTML Form SELECT element's many options and submits the form via a POST action. ...
3
by: Rico | last post by:
Hello, I have a generic process that logs errors from different sources. When I call this code, I'd like to also submit the name of the function or sub that is raising the error without having...
18
by: Pedro Pinto | last post by:
Hi there once more........ Instead of showing all the code my problem is simple. I've tried to create this function: char temp(char *string){ alterString(string); return string;
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.