Creating A Routine To Decode A 0-255 Number Into Specific Values?
Oct 22, 2011
This is kind of a brain twister. First, what it involves. I'm writing an application that is working with values sent to and received from an 8 bit micro-controller. There are 8 bits of specified values. Here they are. bit1 = 1, bit2 = 2, bit3 = 4, bit4 = 8, bit5 = 16, bit6 = 32, bit7 = 64 and bit8 = 128.I made a routine that uses 8 checkboxes to add the values for sending them to the micro-controller. That wasn't too hard. In my appp there are 8 checkboxes. Each checkbox assigns one of the specific bit values to a variable (or subtracts it when unchecked). The total of the variable is then displayed in a textbox and ready to send.Now the hard part that ed to take any number between 0 and 255 apart in values that will be a combination of the numbers (1,2,4,8,16,32,64,128) above and show each checkbox which is assigned those numbers to be checked.
View 6 Replies
ADVERTISEMENT
Oct 20, 2009
I have a datagridview in my project that is loaded with data from a SQL table when the form loads. One of the columns contains names of users in the database. I'm wondering what is the best way to the number of times a name appears in the column. For example, the user name "Rob Smith" might be listed 12 times in the column,I'd like to pass that number to a textbox.
View 3 Replies
Jan 4, 2012
I am creating a class that searches a binary file for a specific customer number. I am using a binary search that keeps on slicing the file in half until I find the customer number while is sorted. Once it finds it I am positioning it at the first instance of that Customer number as there can be multiple records with the same Cus Number.
Now here is my question. I now need to loop through this Customers records and do some data base searches. Since I want to make my class as generic as possible what should I pass back to the calling class? An Array with all their records. If I do this I have to loop twice, once in the class and once when it passes the array bac to the original calling class?
[Code]....
View 20 Replies
Apr 22, 2010
I want t to equal a new random number everytime but it only gives a random number the first time and then uses that same number everytime.
Private Sub Form9_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
notreduced(Label17, Label14)
[code].....
View 4 Replies
Jun 14, 2010
I have written a text editor for an assignment but I am struggling on where to start on this bit. What I Want To Happen:- When the user saves there work I want the name of the file to be shown next to the name of the program at the top left hand side of the form. I am not sure If I just need to create a simple sub routine for adding the name of the file then calling the method in the save as routine.
View 7 Replies
Feb 24, 2009
I'm writing a program to help me understand 3d points and how computers manipulate them to 2d. Every time I run the conversion routine in my program the value I passed to it get's manipulated even though I use the ByVal key word. Here is the code in process order , tell me if I missed something here ?
[Code]...
There is a status box for me to check one of the values :> This is the flow of what I have put together so far. The problem is once I run the program everytime I press the up key to make a call to the GetPoints method the value in MyPoint is changed to reflect the forumula in the getpoints method. I explicitly used ByVal in my variables on the method call so the values in the variable would not be manipulated. I've changed it many times but I can't seem to get the method to run where it does the conversion without manipulating the values in MyPoint. I've done similar things in visual basic .net 2003 , Now I am using the visual basic .net 2008 express edition. I don't if there is a difference in the two or some unknown bug.
View 1 Replies
Mar 12, 2012
If IsNumeric(Hundreds.Text) Then
HundredsTotal.Text = (CDec(Hundreds.Text) * 100).ToString("##,##0.00")
DollarAmtVar = CDec(HundredsTotal.Text)
[CODE]..
The above code is from a small program I have written. This test is done on about 30 textboxes I am using for the user to enter number.
The following is the sub routine that is called.
Sub ShowError()
MessageBox.Show(BoxName & " must be a number.")
End Sub
Here is what I want to do but it won't work.
BoxName.Select()
This is so I can put the focus on the different boxes that might contain an error.
View 4 Replies
Jan 24, 2012
I am using sockets to send message between computers. I send the messages alright. What I want is when the message "x0x" comes, the client must be closed within 5 minutes. Teh admin can cancel the request by sending message "-xx" as well. The routine that checks for incoming connections and accepts messages uses WHILE TRUE...END WHILE since it must always listen. Once I get a message, I need to fire a timer control or other that fires within 5 minutes. But the program cant leave the WHILE TRUE at all. If i exit it early, the timer fires and the program does get exit. How do I fire the timer or other routine while still the WHILE TRUE routine checks for incomin connections and messages?
View 5 Replies
Apr 17, 2011
is there any way to reference a particular code routine in VB.net external to the current loop/routine?Example:
If Var01 < 5
[Routine A]
Else
[Routine B]
End If
where Routine A and Routine B are code sequences at the end of the entire program -- such as outside of the current sub or class? The idea would be to reference an otherwise repetitive code.
View 4 Replies
Dec 13, 2010
i am a beginner in vb8 i have a text file named alarm.txt,sample alarm.txt file is shown below
can someone help me to read the alarm.txt file and extract data.for eg
[Code]...
View 1 Replies
Dec 27, 2009
I wish to read a web page that had various frames and div elements.To start with I would like to create a routine that justs lists all of those elements values and then display each element name and its value so I know what I have and how to reference it later on.I have been using the WebBrowser control and have managed to do a few basic things so far like go to a website and auto login.
View 2 Replies
Dec 30, 2009
please tell me what is below code doing? is it creating array with two values or its creating to string index which will take value later? [code]
View 4 Replies
Mar 3, 2009
I have a sub routine where I pull in information from a database. I want to use variables from this sub routine in another sub routine. I tried making everything public but it doesn't want to be friendly and share.
Dim strEmail as String
Public Sub readDB()
strEmail = "whatever@doohikcy.com"
[Code]....
The readDB would read the database and set the variables and do whatever it needs to do. Then when they submit the form it would e-mail the form to whatever the email address was.
View 2 Replies
Aug 11, 2010
I have a problem with a sql query. Through the query I am trying to search database for any occurrences of string (can be anything) in a column using the SQL LIKE command. The problem is that it works fine for most of the strings say john, jim, ji"m , but does not work when i include the following characters which are ( ' , { , } , and a single quotation mark). MYSQL query takes care of these special cases by putting them in [] block whenever user enters them .But i am getting the following error when i go to query the database using the GetSelectCommand() in VB.NET
Exception Details: System.ApplicationException: Number of values provided must be equal to the number of placeholders in query.I have checked the query over and over again .. but its fine .My database server is Sql Server 2008.So my application throws the exception in this command:
Using reader As MustDisposeDataReader = _
pmSystem.DatabaseManager.GetSelectCommand(selectStatementBuilder.ToString(), New Object() {})
Where MustDisposeDataReader is an instance of a class in an internally developed library, which inherits from System.Object. pmSystem is an instance of the class PlanManagerSystem which implements the commandlayer. GetSelectCommand() takes the select command
View 1 Replies
Apr 12, 2010
being used to PHP and the easiness of creating arrays with no specific size... I'm hating arrays in VB.
Is there a way I can create an array who's size I won't know?
I'm pulling information out of an XML file and need the information available in another sub - so I'm stashing it in a public array I create at the beginning of the form.
[Code]...
View 4 Replies
Mar 8, 2009
Is there a way to have your program automatically create a proxy for a specific browser, like IE, when your app is running? I was thinking that maybe you could create a VLAN proxy or something and a button on the app to toggle it on and off. But I'm not sure how or if one can do it.
View 1 Replies
May 12, 2012
Is it possible to create a variable that is global for each session in ASP.NET? Usually I do this with Session:
Session("my_variable") = 10
But this necessitates casting it every time I want to use it like so:
Dim my_variable as String = CInt(Session("my_variable"))
[code]......
View 2 Replies
Oct 24, 2010
I'm trying to create a CBT hook to an application, in this case Notepad.
[Code]...
EDIT: I have also tried it on a Windows XP system now, and it doesn't work there either.
View 2 Replies
Nov 21, 2009
there, I haven't been using Visual basic for long and was wondering how I would go about solving a problem I have. Basically I have a list of link in notepad which look similar to this (just a lot more of them):
[Code]....
View 9 Replies
Sep 21, 2009
I am trying to extract a number from a specific line and finding it an arduous task.
-#comments">18 comentarios</a></span>
I need the number before the word commentaries. This is a common phrase to search for and extract. the start of the line varies.
View 3 Replies
Aug 12, 2011
Anyone knows how to get the line number of a specific line in a .txt file?[code]...
View 17 Replies
Nov 8, 2011
I have a project that i am getting an XML file that has an embedded PDF file that is encode in UUencode. Is there anyway to do this in VB.net?
View 1 Replies
Jun 24, 2012
I would love to read the QueryString value of t. So i can parse it as GUIDUnfortunatelly that & thing, seems to mess things up.
View 1 Replies
Jul 19, 2011
I have to provide a client with a method to retrieve data from an Audiometer. The equipment is discontinued, but they have six of these and are used every work day. Using port monitoring and the DUMP command on the peripheral I was able to read the data and save to file. Now my challenge is decoding each line. It appears that only a section of the string is not in plain values.I added the pipe separators for clarity. I have determined those columns are: EMPID | DateTime | TechID | Results | ResultType = Test.[code]
View 8 Replies
Jun 15, 2012
I want to copy files with a specific extension (for example .config or .exe). It should create a structure of nested directories, and then insert each file into a specified place in the directory hierarchy. Ideally I would just specify a parent directory for each file and a parent directory for each directory and it would build it.
I need any existing utility or batch file or power-shell script or C#/VB .Net code to perform this activity.
View 2 Replies
Mar 23, 2010
i want to create buttons at runtime using vb.net. In my form have 1 textbox and 1 button. at runtime when we input number in textbox than click ok, the button will create follow in textbox and this value it remeber when we run again the buttons will load follow the last number in textbox, when we input new number in textbox it compare small or big than last value. if big add. for location like this
1 2 3
4 5 6
7 8 9
View 1 Replies
Dec 9, 2009
I am supost to code a program for my homework using an one-dimensional array.in the program you enter the number of the moth and it gives you how many days are in that month. and I'm just kind of lost?
View 2 Replies
Dec 3, 2009
I want to start multiple threads but not a specific number. For example;
private sub do_sth
...
end sub
[Code]....
View 1 Replies
Nov 23, 2009
In VB.NET, let's assume I have the following Structure:
Public Structure Product
Public ItemNo As Int32
Public Description As String[code].....
How would I define a LINQ Query to Sum all of the Product.Cost values in the List? In other words, what would be the LINQ Query in VB.NET to return the value 120.90, which reflects the sum of all three Product Cost values in a single LINQ Query?
View 2 Replies
May 20, 2010
I am having a string in CSV format.http:[code].....I can add new values to it by some mechanism. Everything will be same except the new values will have numeric part = 0. Take example I have this exsiting CSV string
1 , abc.txt , 2 , def.doc , 3 , flyaway.txt
Now by some mechanism i added two more files Superman.txt and Spiderman.txt to the existing string. Now it became
1 , abc.txt , 2 , def.doc , 3 , flyaway.txt, 0, Superman.txt, 0 , Spiderman.txt
What i am doing here is that this csv string is paased into SP where its splitted and inserted to db. So for inserting I have to take the files with numeric part 0 only rest will be omiited .Which will be further then converted into CSV string.Array will look like this
str[0]="1"
str[1]="abc.txt"
str[2]="2"[code].....
So at last i want to say my input will be
1 , abc.txt , 2 , def.doc , 3 , flyaway.txt, 0, Superman.txt, 0 , Spiderman.txt
Desired Output:
0, Superman.txt, 0 , Spiderman.txt
View 1 Replies