If Palcheck1 Is Greater Than Palcheck 2 Then It Is A Palindrome?
Jan 12, 2010
I am working on a project for the next week of my course and have the code built already and running but there was one section of it that looking at it I just dont understand why it works correctly.[code].....So i get that the second if statement here says that is palcheck1 = palcheck2 then its not the same telling the program its not a palindrome. But in the first part of it if palcheck1 is greater than palcheck 2 then it is a palindrome.
View 6 Replies
ADVERTISEMENT
Apr 17, 2012
I'm having a very difficult task here. I need to analyze a certain text and find the minimum number of characters it needs to become a palindrome. The text will not have any special characters or numbers, just alphabet letters. Now, I've made some progression and have tried a lot of situations correctly, but in some situations I've gotten wrong outputs on the MINIMUM number of characters needed. I've tested the below texts:
View 2 Replies
Nov 28, 2011
why i cant get the right output for a palindrome sentence.
Public Class Form1
'declaring variables
Dim strword As String
[Code]....
View 8 Replies
Dec 4, 2009
in my vb.net code i m using filename as palindrome.java but i want only a program without any extension.
View 4 Replies
Apr 24, 2011
I need to create a a palindrome checker program. Now I know how to check a simple palindrome by using the reverse method however I am unsure if the palindrome had special characters or spaces. My question is what is the code for removing spaces and special characters from a string using loops and if statements. Also we cannot use arrays.
View 9 Replies
Apr 12, 2010
I need to create a code using String Compare() and Cases to figure out if a word, phrase, or what is typed in a textbox is a palindrome. If it is, a message will appear in a label under the textbox that reads, "What you typed is a palindrome." Or, "What you typed is not a palindrome." , if it is not.
View 16 Replies
Mar 9, 2009
I am having problems getting this program to run. It is a palindrome checker, you are suposed to enter a word or a phrase and determine weather it is a palindrome. The code is suposed to contain a Boolean valued function, and should display true or false if word(s) are palindrome.
Here is my code
Private Sub btnAnswer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnevaluate.Click
Dim Input As String
If IsPalindrome(Input) Then
txtAnswer.Text = "True"
[code]....
View 10 Replies
Dec 8, 2011
I'm working on a problem where i have to allow a user to input a word or phrase and then determine if it is a palindrome (a words that reads the same forwards and backwards) . It also says that the program should use a Boolean-valued function procedure named IsPalindrome that returns the value True when the word or phrase is a palindrome and the value False otherwise.
View 3 Replies
Sep 1, 2011
I am working on my program as I have created picturebox1 and splitter1 in my program. I am coding on the if statement as I am trying to compare on the value that if they are less than 184, then do something.
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
If Splitter1.Location <= New System.Drawing.Point(184, 0) Then
[Code]....
I know that I can't compare the value using with <= which I will only have to use = instead of <=, but i still want to compare with the value that if it less than 184, then do something.
View 5 Replies
Feb 14, 2011
How should I write not greater than 0 in VB.NET?
psuedocode:
if x is not greater than 0 then
do something
[code]......
View 4 Replies
Nov 5, 2011
im working on a project that is calculating the total population for given countries and its in the hundreds of thousands. And i need to output the population with the ,'s in the appropriate places.Ex. population 123456789 i need to output it in a listbox as 123,456,789 so im looking for a converter function or something built in that takes my value
[Code]...
View 3 Replies
Mar 5, 2009
How to compare Two Dates if it is Less Than or Greater Than?? I want to know the code that shows an msgbox "Date Past" if the date in a datepicker is already past.
View 6 Replies
Jun 12, 2009
Im trying for a message box to pop up with a price, depending on the time. Before 11:30 costs £3.00, afterwards costs £4.50. This is what i have tried but it this code gives me the message for £3.00 when the time is over 11:30 Dim day As String = Format(Today, "dddd")
[Code]...
View 7 Replies
Dec 14, 2009
Need to return the greater of 3 values. Each value is based on user input and system calculations. Requirement = the greater of (Req1, Req2, Req3) Have tried a number of "If" "Else" and Ifs within Ifs "<" and ">" combinations without consistant results. This may seem simple to some but I am relatively new to VB. My search on MSDN was not fruitful.
View 11 Replies
Feb 12, 2010
This makes no since to me I have a textbox that the user will put in information that I need to cut off so I wrote this code
txtMatID.Text = Trim(Mid(txtMatID.Text, 1, (InStr(txtMatID.Text,
"-") - 1)))
The user will imput a number value then a - then some words after that. I just want the number value. But when I try to debug the app it breaks on this line of code with this error. Argument 'Length' must be greater or equal to zero.
View 11 Replies
Jun 13, 2011
In my decryption statement I am getting
Argument 'Length' must be greater or equal to zero. is this statement wrong
DecodedStr = Mid(DecodedStr, 1, InStr(DecodedStr, Right(DecodedStr, 4)) - 1)
View 2 Replies
Sep 26, 2011
I disabled an exception because it was bugging me i couldnt find an intermittent error. My program reads textmessages from a phone, however a problem sometimes arises, and I am slowly pinpointing the areas of the code that cause issues. I have found however that it is sometimes here:
'Get a string of certain length
Shared Function GetString(ByRef PDUCode As String, ByVal Length As Integer) As String
[Code]....
check to see if length is zero AND thereofre try again in a moment, (because it usually works second time for some reason). I can think how to get around the exception
View 2 Replies
Aug 17, 2010
Say I convert some seconds into the TimeSpan object like this:
Dim sec = 1254234568 Dim t As TimeSpan = TimeSpan.FromSeconds(sec)
How do I format the TimeSpan object into a format like the following:
>105hr 56mn 47sec Is there a built-in function or do I need to write a custom function?
View 4 Replies
Jan 12, 2011
I have a string variable that contains the following html data:
<p>
<em><strong>This is some <span style="background-color: rgb(255, 255, 0);">rich </span>text. 3 < 5 is a valid statement. <br />
[code].....
View 1 Replies
Dec 15, 2009
I am having the following problem with a chart displaying a value that is heldwithing a variable but 10 times lager. But this is only happening in my programfor a user that is located in the Netherlands.If I run it from the UK or other people run it from other countries the valuesare displayed correctly, it only seems to be a problem for this one userin the Netherlands.I have checked my code and all is correct and there are no Multipliers added tothe value.To show what I mean see below, as I do not have the code to hand as I am currently at work.
View 2 Replies
Jun 2, 2010
I have two columns of numbers that hold team scores for different events. I am looking for a OO way to Color the textbox of the team with the highest score in each event. I know the following will not do it (without writing a complex set of If Then Statements) but I think it might paint a clearer picture of what I am trying to do.
VB
Private Sub ColorWinner(ByVal crtl01 As Control, ByVal crtl02 As Control)
If CDec(crtl01.Text) > CDec(crtl02.Text) Then
crtl01.BackColor = Color.Gold
[Code].....
The controls are always going to be text boxes. So basicaly I want to determine the text box with the highest value and act on it without having to write a complex series of nested IF Statements.
View 2 Replies
Dec 22, 2010
I've been using the following code to download a text file from the web. It only downloads the first 100,000 bytes of the file which is no good if the file is big. The size of the file I'm downloading can vary from day to day, so I need to be able to download a text file of any size.
Dim wr As HttpWebRequest = CType(WebRequest.Create("http://sooty.postalgroup.co.uk/tempmac/nat-import.txt"), HttpWebRequest)
Dim ws As HttpWebResponse = CType(wr.GetResponse(), HttpWebResponse)
[Code].....
View 3 Replies
Mar 8, 2012
I have a DropDownList control and I want to set the SelectedValue to the lowest value in the dropdownlist greater than 0 for example my control drpExample has the following values:[code]I want to use drpExample.SelectedValue = The lowest value greater than 0..The SelectedValue should then be 0.90..Is there a simple way to do this?
View 3 Replies
Apr 11, 2012
I thought I had this sussed until I then wanted to filter between two values or greater than or less than two values. I have searched and searched all over the web for this and I just go round in circles. This is so frustrating why is this so difficult to find something so basic (anyway that is my rant). I have something like this but am totally confused and do not understand what I am doing now: how I get this working in plain English.
Me.BindingSource.Filter = String.Format("DeliveryDate >= #{0:MMM/dd/yyyy}# And DeliveryDate <= #{1:MMM/dd/yyyy}#", dtpStartDelDate.Value.Date, dtpEndDelDate.Value.Date) _
& String.Format("JobID >= {0} AND JobID <= {1}", txtStartJobID.Text, txtEndJobID.Text)
If I run this with just the date range filter it works fine it is when I add the second filter for the Job ID range I get the following error; {"Syntax error: Missing operand after 'JobID' operator."}
So I it is this line I have the problem with:
String.Format("JobID >= {0} AND JobID <= {1}", txtStartJobID.Text, txtEndJobID.Text)
View 10 Replies
Apr 26, 2010
Can I do this to find the lowest value in an array greater than zero?
Dim findLowest() As Integer = {right, left, backRight, backLeft}
Dim theMove As Integer = findLowest.Min > 0
Can't seem to find it on MSDN.
View 5 Replies
Oct 27, 2010
I'm using vb10.I'm trying to generate cryptographic numbers greater than 256.I've read the windows examples and examples submitted by users.I don't understand how to tell it to use more than one byte.have an example to show me using 2 bytes or 0-65536?Also, what if my range is say 1024-32768? how do I tell it not to go beyond those bounds?
View 3 Replies
May 27, 2012
I have data which can be put inside listboxes, I then proceed to save the data into a textfile then attempt to load it. This all works great until a number of over 1000 appears because it's read as 1,000 and VB thinks the Comma means to go onto the next field.
'put record into the line in correct format
sLine = sCallCentreOperatorID & "," & sCallCentreName & "," & sQuoteNumber
sRecord = reader.ReadLine
[code]...
View 5 Replies
Jan 23, 2012
I have a datagridview where I have added a filter. What I am trying to do if the user leaves the field blank I want all the records to show. The field I am filtering on is an integer. I thought I could declare a variable and if the field is blank include all records greater than 0. This would return all records as the number will never be below 0. I tried this but can't get it to work:
HTML
If txtFiltID.Text = "" Then
sSerialID > 0
Else
sSerialID = txtFiltID.Text
End If
'Refresh dgv on filtered criteria
Me.VJobLinesTableAdapter.FillByFilter(Me.DsJobs.vJobLines, sSerialNo)
It works fine if the user enters a value.
View 10 Replies
Sep 28, 2011
I have a simple routine to find the next object based on a name property in an un-ordered collection of objects. I go through the collection and collect all the names in a List(of String) adding any names that are > my current name, which should give a list of everything that comes after the current key. I then sort the list using the default .Sort() method on the List(of String) and take the first item in the list, which should be my next item. I do the reverse to find the previous item, add all items < my current name, sort, and take the last item in the list.
However, this method skips over some items. For example I have items named 1210, 1210-ADA, and 1210_ADA_DB. Using this method, getting the next item skips the middle item 1210-ADA and finds 1210_ADA_DB, but finding the previous item seems to work.
[Code]...
View 2 Replies
Mar 28, 2009
I'm building an app that does calculations (in dollar amounts). I want to buildin a constraint that says the value entered into text box must be greater than 0. If the user does not follow this rule, I want them to get an error message.I have the calculations built and the error message, but not the constraint statement i.e. if users enter negative numbers the ouput is negative, which in the context of this app makes no sense. how a statement that would require the value entered into a text box to greater than a value.
View 3 Replies