I have 2 if statements that are unrelated to each other,
but the outcome of the variable of each of these are.
Here is my first one:
If sToEMail = "" Then
sTo = "DT" & CStr(lDistrictN br)"@microsoft. com"
Else
sTo = sToEMail
End If
Then my second one:
If iCall_Type = 9 Then
sTo = sCmd
End if
Both IF's need to be evaluated, but not sure how to
handle this with the outcome of the sTo variable.
Help?
Thanks! 9 1350
Hi,
What is sCmd?
In any case, it seems straightforward - if this is the code sequence, sTo
ends up being the designated email address or sCmd. What am I missing here?
Bernie
"Thanks2U" <an*******@disc ussions.microso ft.com> wrote in message
news:00******** *************** *****@phx.gbl.. . I have 2 if statements that are unrelated to each other, but the outcome of the variable of each of these are. Here is my first one:
If sToEMail = "" Then sTo = "DT" & CStr(lDistrictN br)"@microsoft. com" Else sTo = sToEMail End If
Then my second one:
If iCall_Type = 9 Then sTo = sCmd End if
Both IF's need to be evaluated, but not sure how to handle this with the outcome of the sTo variable.
Help?
Thanks!
"Thanks2U" <an*******@disc ussions.microso ft.com> wrote in message
news:00******** *************** *****@phx.gbl.. . I have 2 if statements that are unrelated to each other, but the outcome of the variable of each of these are. Here is my first one:
If sToEMail = "" Then sTo = "DT" & CStr(lDistrictN br)"@microsoft. com" Else sTo = sToEMail End If
Then my second one:
If iCall_Type = 9 Then sTo = sCmd End if
Both IF's need to be evaluated, but not sure how to handle this with the outcome of the sTo variable.
Help?
Thanks!
If iCall_Type = 9 Then
sTo = sCmd
ElseIf sToEmail = "" Then
sTo = "DT" & CStr(lDistrictN br) & "@microsoft.com "
Else
sTo = sToEMail
End If
Is this what you need?
Mythran
* "Thanks2U" <an*******@disc ussions.microso ft.com> scripsit: I have 2 if statements that are unrelated to each other, but the outcome of the variable of each of these are. Here is my first one:
If sToEMail = "" Then sTo = "DT" & CStr(lDistrictN br)"@microsoft. com" Else sTo = sToEMail End If
Then my second one:
If iCall_Type = 9 Then sTo = sCmd End if
Both IF's need to be evaluated, but not sure how to handle this with the outcome of the sTo variable.
\\\
If ... Then
...
ElseIf ... Then
...
ElseIf ... Then
...
End If
///
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
He indicated that both If's need to be evaluated. In yours,
ElseIf sToEmail = "" Then
will not be tested if: iCall_Type = 9
"Mythran" <ki********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. .. "Thanks2U" <an*******@disc ussions.microso ft.com> wrote in message news:00******** *************** *****@phx.gbl.. . I have 2 if statements that are unrelated to each other, but the outcome of the variable of each of these are. Here is my first one:
If sToEMail = "" Then sTo = "DT" & CStr(lDistrictN br)"@microsoft. com" Else sTo = sToEMail End If
Then my second one:
If iCall_Type = 9 Then sTo = sCmd End if
Both IF's need to be evaluated, but not sure how to handle this with the outcome of the sTo variable.
Help?
Thanks!
If iCall_Type = 9 Then sTo = sCmd ElseIf sToEmail = "" Then sTo = "DT" & CStr(lDistrictN br) & "@microsoft.com " Else sTo = sToEMail End If
Is this what you need?
Mythran
I did not understand the question, now I saw the message from Scott I
understand it. If sToEMail = "" Then sTo = "DT" & CStr(lDistrictN br)"@microsoft. com" Else
If iCall_Type = 9 Then
sTo = sCmd
else
sTo = sToEMail
End if
///
Cor
I still don't think that this will satisfy the original requirement that
both if statements be evaluated. In yours, if:
oEMail = ""
then iCall_Type will not be tested for 9.
I think he just needs the 2 if statements, one after the other.
His original post showed him ussing:
If sToEMail = "" Then
sTo = "DT" & CStr(lDistrictN br)"@microsoft. com"
Else
sTo = sToEMail
End If
If iCall_Type = 9 Then
sTo = sCmd
End if
This seems to be correct to me. The question now becomes, which if is more
important than the other. If he has one variable that will be changed by
one of 2 other variable values, then is it more important that sTo be sCmd
when iCall_Type is 9 or not. The order of the if statements may need to be
reversed.
"Cor" <no*@non.com> wrote in message
news:Oq******** ******@tk2msftn gp13.phx.gbl... I did not understand the question, now I saw the message from Scott I understand it.
If sToEMail = "" Then sTo = "DT" & CStr(lDistrictN br)"@microsoft. com" Else
If iCall_Type = 9 Then sTo = sCmd else sTo = sToEMail End if ///
Cor
In your sample will the previous test be for nothing if cmd = 9
If the 9 test would be the most important, than it should in my example have
to change place with the test for space I still don't think that this will satisfy the original requirement that both if statements be evaluated. In yours, if:
Not sure what test you mean by "previous test", but in my example (actually
the original post's example), both tests are carried out.
I just don't see how your nested If test in the Else section would be
carried out if the first If returns true.
"Cor" <no*@non.com> wrote in message
news:Om******** ******@TK2MSFTN GP10.phx.gbl... In your sample will the previous test be for nothing if cmd = 9
If the 9 test would be the most important, than it should in my example
have to change place with the test for space
I still don't think that this will satisfy the original requirement that both if statements be evaluated. In yours, if:
There is a typo in, but I asume that you did see that the last "end if" was
missing. If sToEMail = "" Then
(if there is no emailadres send a mail to microsoft)
sTo = "DT" & CStr(lDistrictN br)"@microsoft. com"
(if there is an mail adres than do something else)
Else
If iCall_Type = 9 Then
(if it is a Icall, let say intern, than do this)
sTo = sCmd
else
(send to the email adres)
sTo = sToEMail
end if
End if
///Not sure what test you mean by "previous test", but in my example (actually the original post's example), both tests are carried out.
I just don't see how your nested If test in the Else section would be carried out if the first If returns true. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Glen |
last post by:
I have a Struts action form which contains a bean. I am trying to
display a bean retrieved from the database in this form using the
nested tag. Can anyone help me? I continue to get an error message
see end for stack trace.
Struts config
<form-bean name="newBean" type="com.NewForm" />
......
<action path="/new-action" type="com.NewAction"
name="newBean" scope="session">
|
by: Andy Baker |
last post by:
Hi there,
I'm learning Python at the moment and trying to grok the thinking behind
it's scoping and nesting rules.
I was googling for nested functions and found this Guido quote:
(http://www.python.org/search/hypermail/python-1993/0343.html)
"This is because nested function definitions don't have access to the
local variables of the surrounding block -- only to the globals of the
|
by: Erik Bongers |
last post by:
Hi,
Nested classes only seem to be able to access static members of the
surrounding class :
class SurroundingClass
{
public:
class InnerClass
{
public:
|
by: nimmi_srivastav |
last post by:
Below you will see an example of a nested conditional expression that
this colleague of mine loves. He claims that it is more efficient that
a multi-level if-else-if structure. Moreover, our complexity analyzer
tool supposedly does not pick it up. Is it really more efficient?
Personally I find this coding style extremely cryptic, misleading and
error-prone.
I believe that I have removed all traces of proprietary-ness from this
coding...
|
by: B0nj |
last post by:
I've got a class in which I want to implement a property
that operates like an indexer, for the various colors
associated with the class.
For instance, I want to be able to do 'set' operations like
MyClass.MyColors = Color.Green
or, a 'get', such as
Color forecolor = MyClass.MyColors;
I want to use an indexer so I can take parameters, such
as the color type (e.g. "Foreground", "Background" etc.).
With a single member function I couldn't...
| |
by: Robert W. |
last post by:
I've almost completed building a Model-View-Controller but have run into a
snag. When an event is fired on a form control I want to automatically
updated the "connnected" property in the Model. This works fine if all of
the properties are at the top (root level) of the model but I'd like to keep
them in nested classes to organize them better.
So, for example, part of my data model looks like this (simplified) :
public class MainClass
|
by: Tomas Sieger |
last post by:
Hi all,
I'm in doubt with the following code:
class Base {
public:
class Nested {};
};
class Derived:public Base {
public:
class Nested {
|
by: Peter Olcott |
last post by:
http://www.tommti-systems.de/go.html?http://www.tommti-systems.de/main-Dateien/reviews/languages/benchmarks.html
The above link shows that C# is 450% slower on something as simple as a nested
loop. Is this because .NET is inherently slower or does the C# compiler merely
produce code that is not as well optimized as the C++ compiler?
|
by: patrick j |
last post by:
Hi
I'm wondering about lists with nested lists as one does on a Saturday
afternoon.
Anyway below is an example of a list with a nested list which the iCab
browser's very useful HTML verification ability will not like:
<ul>
<li><a href="#">link</a></li>
|
by: jdurancomas |
last post by:
Dear all,
I'm trying to declare the operator++ to a nested class. The nested
class is not template but the container it is.
The code used in teh sample program is included bellow:
#include <iostream>
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |