Windows - Evaluate Two Function In One Statement?
Feb 25, 2011
I am using a two-dimensional array of 10 elements, but my code is extremely slow.
[code]...
I create a new empty array with every iteration of the for loop. Is there a way I can use the same array but just clear it instead?
View 2 Replies
ADVERTISEMENT
Apr 18, 2012
How to declare two object in one statement for vb.net?
Example
If IsNumeric(TextBox1.Text),(TextBox2.Text) Then
lbl_answer.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
Else
MsgBox("Error only number can be calculate")
End If
I can do
if isnumeric(textbox1.text) then
But I can't say
if isnumeric(textbox1.text), (textbox2.text)
How can I do so?
View 1 Replies
Dec 9, 2011
So I am trying to evaluate 3 conditions in an if statement. Its not working how I would assume it should. I basically want to do this:
vb.net
If PGN = &HEF007E And PGNData(0) = &H58 And (PGNData(1) And &H40) = &H40 Then IgnOn = True Else IgnOn = False
If I write it in that manner it gives inconsistent results. If I workaround by writing it this way it works perfectly:
vb.net
If PGN = &HEF007E And PGNData(0) = &H58 Then
If (PGNData(1) And &H40) = &H40 Then IgnOn = True Else IgnOn = False
Endif
What is the proper way to do this with only one if statement?
View 7 Replies
Jan 8, 2009
I am use to coding in php and everything does not need to evaluate to true or falst in an if statement. I have this [code] How would I make that return true or false?
View 3 Replies
Jul 15, 2010
Is there a way to make a VB case statement evaluate all the cases? Similar to a java switch statement (without the break).
View 5 Replies
Feb 27, 2009
How can I use the Evaluate function in VB.net in Visual Studio 2008 so that to evaluate a string which consist of 2 variables to be evaluated.[code]...
View 2 Replies
Sep 25, 2009
I need the create a function with two variables Price1 and Price2 and the following rule:
if Price1 > Price2 at time t and not (Price1>Price2) at time t-1 Then
result=true
else
result=false
I should be able to use a loop to store the time t and t-1 Price1 and Price2 values.How can I do this in VB.net
View 11 Replies
Jul 1, 2009
Is it possible to use 2 exists function in 1 sql statement. Below are part of my
select m.ModuleName,sh.Day,sh.Time,sh.Venue FROM Module m INNER JOIN Schedule sh ON m.ModuleID = sh.ModuleID INNER JOIN Student s ON sh.StudentID = s.StudentID WHERE EXISTS (Select * FROM MsgIn WHERE MsgIn.MsgNumber = s.Phone) AND WHERE EXISTS (Select * FROM MsgIn WHERE MsgIn.MsgContent LIKE '%MON%' = sh.Day)
I tried to do like this but an error occured.
View 1 Replies
Sep 13, 2010
The following works:
[Code]...
However, the following doesn't work:
View 4 Replies
May 22, 2012
I have this code:
[Code]...
EDIT: CELL_VALUE_FLOAT is a Nullable(Of Double) and CELL_VALUE_INT is a Nullable(of Integer) In Quickwatch the condition evaluates correclty to False, but when running the If() function evaluates to the True part.
View 3 Replies
Jul 14, 2009
I know normaly you have to use Return before "End Function", but now the Return is in the Try and Do statement and I can't find a way to variable the Return.[code]...
View 7 Replies
Sep 28, 2009
I am a little confused about the use of a return statement in a function. If I understand correctly the return statement returns a value but where? Where is the value being returned to?
View 1 Replies
Mar 9, 2012
I have a multiple-value-single-string as a parameter field in a report in Report Builder 3.0 (e.g. 20124, 20125). Now I want to split up this string, and show "Summer 2012" instead of "20124" and "Fall 2012" instead of "20125. I am using Visual Basic. Here is my two functions I have made in Report Builder 3.0 custom code. The error is in the second function in the "If Right(yearterm)..." line. It gives me a syntax error. If I write "String.Right" it gives me the error: "'Right' is not a member of 'String'". If i take out the whole "If statement" the report will run but "20124,20125" gives me this: ", 2012, 2012".
Public Function SplitParameterValues(ByVal parameter As Parameter) As String
Dim result As String
Dim a(0 To 10) As String
[code]....
View 1 Replies
May 1, 2012
I have 2 functions that need to work together.1 function is to generate a chart number. The other function is to search via SQL to see if the chart number exists. if the chart number doesn't exist then i need function 2 to return a boolean value so function one can generate a new chart number example code: [code] Now i know that i am probably using the incorrect sql statement, my main issue is that i dont know how return available back to the function.
View 1 Replies
Jun 16, 2011
I have something that I want to do and what looks very simple, but I cannot get it to work. I want to build a function that gets as input a xdocument and some other strings. It should have a return that contains a filtered part of the xdocument in a way that I can use it as input for a new Linq function. This is what I mean:
Private Function fncGetFilteredDecendantsOfNode(ByVal xdocDoc As XDocument, _
[Code]...
View 2 Replies
Jun 1, 2009
I have trouble with my vb application.I create query in dataset like this :Select * from Trans where year(dateTrans)=2009 and month(dateTrans)=5But is not work and error message : year and month function not identified, what is the problem ? what a sql date function ?If i create databound from dataset and drag n drop date field in form with datetimepicker control, if i had update dataset, date field is empty.Whats wrong with datetimepicket databound.
View 5 Replies
Apr 12, 2010
1. I would like to know why a Return statement is needed in the function in the first set of code, but not in the second(even though it still works with the Return statement). The functions are called the same way, so what is the difference?2. Why in the second code, the variable FutureValue is allowed to have the same name as the function? But when, in the first set of code, I try to rename the variable "discountPercent1"(in the function) to the function name "SetDiscountPercent", VB 2008 Epress gives the error message "The name conflicts with an existing symbol with the same name"?
Public Class frmInvoiceTotal
Private Sub btnCalculate_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnCalculate.Click
[code].....
View 4 Replies
Feb 14, 2012
What is the wrong in the below code?
ClientScript.RegisterStartupScript(
Me.GetType(),
"key",
"return confirm('Are you sure you wish to delete these records?');",
True)
View 2 Replies
Oct 23, 2010
I'm fairly new to learning visual basic. I'm trying to create a program that dynamically generates a EXE file that performs mouse movements and keystrokes. To dynamically generate EXE files, I am using the CODEDOM API for Visual Basic.
[Code]...
View 2 Replies
Jan 10, 2011
I have used the following code to shutdown the system but it will perform logoff windows
Private Const EWX_LogOff = 0
Private Const EWX_SHUTDOWN = 1
Private Const EWX_REBOOT = 2
P[code].....
View 3 Replies
Mar 15, 2009
In Access, it is easy to call a user defined function in a sql statment, exampleSub AAdim mDb as[code]...
View 5 Replies
Jun 18, 2010
I am having issue with this function where wait_rtn statement does not work and errors out with error 0. it is suppose to search the screen and if it finds (true) get out of the loop...
[code]...
View 6 Replies
Nov 9, 2011
Can i insert in two tables data with one insert statement in .net VB 2008?
View 1 Replies
Jul 12, 2010
I am trying to clean up my code a bit.
I made the following function:
Public Sub sqlUpdate(ByVal table As String, ByVal column As String, ByVal var1 As String, ByVal column1 As String, ByVal var2 As String)
Public CN As New MySqlConnection
Public cmd As New MySqlCommand
[CODE]...
Which is fine, if I want to use mysql update all I have to do is call something like: sqlUpdate("test", "test", 0, "test", test) I was wondering if I could do the same with the SELECT statement and make a function. I cant think of a way to do it though...
sqlConnect()
Dim cmd As New MySqlCommand
With cmd
.CommandText = "SELECT * FROM users WHERE username=""" & lblAccountName.Text & """"
[CODE]...
The data I would want to extract would be different every time.
View 3 Replies
Aug 17, 2009
I am a excel vba developer, and all public functions i would put in the module. I assumed by creating a .vb rather then a module i can put all functions i use regulary throughout forms in this.however i get the error on this code
Function CopyFile(ByVal x As Integer) As String
Dim FileToCopy As String
Dim NewCopy As String
[code].....
View 1 Replies
Dec 13, 2010
I am exporting the contents of one excel file data to the other excel file by using the range excel object in a windows application. while declaring the object, am getting the error like type excel object is not declared. [Code]
View 1 Replies
May 31, 2012
I get this error:
[Code]....
View 1 Replies
Jan 12, 2011
I've been working of a Visual Basic Windows Form in Visual Studio 2010 as my first little VB project. It's a form which runs a stored procedure on SQL. I have this all working, however, the stored procedure has a PRINT statement execute if a duplicate is found and stops. What I'd like to do is have this PRINT statement display on the Windows form MessageLabel (label) or have a "successful" message displayed if there is no SQL print statement.
[code]...
View 9 Replies
Aug 1, 2010
I'm trying to evaluate a lastname and then set a value. so first two characters of last name btw M-MI would be M1, MJ-MZ would be M2
View 1 Replies
Jan 4, 2010
if i do not need to evaluate all the expressions, am i right to say that there are benefits and no disadvantages of using AndAlso compared to using And
example:
if a=b And f=g And y=k
can be better done with:
if a=b AndAlso f=g AndAlso y=k
View 22 Replies