Pieces Of Code Exhibit Different Results?
May 16, 2011Anyone care to explain why these two pieces of code exhibit different results?
VB.NET v4.0
Dim p As Integer = 16
Dim i As Integer = 10
Dim y As Integer = p / i
[Code]...
Anyone care to explain why these two pieces of code exhibit different results?
VB.NET v4.0
Dim p As Integer = 16
Dim i As Integer = 10
Dim y As Integer = p / i
[Code]...
I am working on a project and the code for FORMS1.vb has become quite large, 20K lines.How can I break this down into more managable pieces. I have tried Modules but I get multiple reference errorsd when I move like all of the reporting code to a module. The report code has nothing to do with the forms other than being able to call that code from an object on the form.
View 3 RepliesI have been getting sometimes with SOME libraries (be it included in the framework or not).[code]I'd expect the func.Call() to return an exception if something is up, or do anything to error out, but here it just murders my method which returns instantly! The same stuff here is also in a loop, which doesn't get any more iterations, it just stops executing this function and continues running the program.
View 1 RepliesI am trying to rewrite some code and I am trying to determine if I am writing it correctly. My goal is to make sure that the old code and my new code produce the same results(i.e. are logically equivalent). Are the 2 code blocks below equivalent?
Old
If a = 1 then
If b = 3 OrElse b = 18 OrElse b = 20 OrElse b = 21 OrElse b = 4 then
' Do something
[code]....
I created a small vb.net console app in visual studio 2008 trying to learn .net but my results show differently when I break in the code and press F11 to step through. If I do it this way, the results I expect to get show but if I don't break into the code the results aren't what I'm expecting.
Basically everytime I click a button i want to write four numbers that are random. If I break into the code, these show random numbers i.e. 1 3 4 3 but if i don't break into the code. my numbers are all the same i.e.1 1 1 1. Here is my code, like I said I'm still learning so the logic is probably not correct.
[Code]...
so im using two split containers to show four different panels at the users request using two buttons. Split container 1 works fine and will only show the panel requested by the user but split container 2 when i hit the button does not hide panel one and only show panel 2 it shows both panels at the same time yet the code for the buttons are exactly the same
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShow.Click
[code].....
I have this code.
vb
Case Keys.U With Me.TextBox1 Dim selectionStart As Integer = .SelectionStart
Dim
[code].....
My app calls for the use of an SP that doesn't return rows from a table, but results based on certain conditions.
View 3 RepliesI have used the code convertor at developerfusion to convert the following two pieces of code (originaly from url...Can anyone tell me how to get the returned Latitude and Longitude values to display in my textboxes named tab5txtLatitude and tab5txtLongitude? [code]Conversion seems to have been done ok apart from the two lines (in red text) which appear to be missing from the converted function.
View 7 Repliesregarding your book "Pro Bussiness Applications with Silverlight 4" there is something that makes me cumbersome. I'm Talking about getting results from a query in code behind.uppossing you are using WCF RIA Services, you are always getting Nothing as a result due to asynchronous mecanism betwwen Server and Client.I've tried to use a BusyIndicator like this (VB), but it doesn't work:
dim ctx as new DomainService1
dim query= from p As Entity1 In Ctx.GetQueryEntity1Query select p
If ctx.IsLoading = True Then
[code].....
At present i have an interface which displays a string of sql code in a rich text box.
I also have my microsoft access database connected to the form.
How would i go about getting the sql code in the rich text box to produce the results for the query??
I have came up with code in my vb.net app that can extract particular tags, but what if I wanted to extract only certain lines of html code?
<td style="min-width: 100px; " align="right" class="aw-td body-td">4,400</td>
how to read a string in pieces.
Let's say the string is 800 characters long. I want to read 100 of them each time. How do I accomplish this?
I'm having a bit of trouble learning the uses of partial classes. I know they are used to split a class into several pieces for convenience but I don't understand how to put all of this into play. I'll show you what I mean here:
Lets say I have an interface named "ICar":
.NET
Public Interface ICar
Sub TurnOn()
[Code]....
OK, now that I have all of that, how do I put it to simple use in my partial class "OffRoader"? (You can add a "console.writeline" event to the methods if you want, in order to show me the uses of these partial classes.)
In my website I have a textbox that allow user to enter a group of numbers like this:
(118,38,137,15,156,14,157,36,152,49,142,57)
Now i want your help to show me the way to store these numbers in array to be like this:
[118 38 137 15 156 14 157 36 152 49 142 57]
I am currently working on a program that edits txt files but it's for a game. There is a file that contains information that the client uses. This is what the file looks like:
|piece of code here|another piece|and another piece|
|piece of code here|another piece|and another piece|
|piece of code here|another piece|and another piece|
|piece of code here|another piece|and another piece|
|piece of code here|another piece|and another piece|
I want to make a program that reads this file and reads each piece of code separately and places them in different places like this:
[URL]
how to replace the html code numbers with the correct ones? i would show you example of html output, but vbforum automatically converts the characters so no point. i wish the replace all the & #40; (without the space) and so on with their correct replacement eg, ( in this case. also would like a short way to do this as i will be using this multiple times. so basically i would like the source to be exactly as it would if you viewed source in firefox browser, not with all the special chars unformatted like visual studio does.
View 3 RepliesIs it possible to add a property to the existing asp:BoundField control without creating a brand new instance to which I'd have to declare <tst:BoundField></tst:BoundField>?
View 1 RepliesAs my company migrates towards the .NET framework from VB6, it looks like we are going in the direction of WPF (my boss is in love with the Office-style Ribbon control). I've been working to mock one of our VB6 applications in WPF and decided to experiment with MVVM at the same time. I'm being discouraged from using an existing MVVM framework, so I guess I need to write my own. The biggest concern right now seems to be a method for registering and managing all my views from a central spot - a manager class - but I'm not exactly sure how to implement this.
View 4 RepliesI wanted to know how to find the code for Chess Titans (Vista) I have the program that can open .dll's and .exe's and explore there structure, I just need to know how to get that code.
View 5 Repliesi am trying to implement a very simple program, that simply copies some text from one window in to an appropriate text box field in the other window. I need to copy and paste about 50 pieces of information from one window in to another.I suppose i can load the entire SOURCE window's text in to a text box control, and then i want to use sendkeys to populate appropriate fields in the other DESTINATION window that i want to populate with this information.My guess is that i will need some kind of windows api (Win XP) to get a handle on the appropriate text boxes in the destination window (or tab through it or something)
View 9 RepliesI am trying to write a code for excel so that it generates results in the last empty column on the sheet. below is a sample data of what is there:[code]
View 3 RepliesI seem to have a huge issue right now trying to grab different pieces of a string to place them in a different order in a list. Unfortunately i can't just find the placeholders for the strings and extract the data that way so i was using indexOf to find commas in the string provided. the problem i'm having is that i can assign the first comma and extract 0 - "," but i'm stuck on how to progress the indexof so it will move through the string submitting everything between the comma's.
Public Class Form1
Private Sub btnAccept_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAccept.Click
[Code].....
What i'm trying to do is retrieve 2-3 pieces of information from a parsed html file, then add the data into a listview in the corresponding columns i was initially going to do a function for each piece of information to retrieve but thought maybe i could do it all with 1 function instead.
[Code]...
In a resource string, not one that you declare in the code, but rather in the resources itself, how do I store multiple pieces of data in it?
View 7 Repliesi can get this program to read the file but i now want to be able to call on the file from another form and use specific pieces of data for login verification and balance handling purposes.
[code..]
above is the contents of my txtfile but how do i reference anything in it?
[code...]
I am trying to come up with a way to store 3 pieces of information for each employee in the company on a daily basis. So for instance
Day 1: Joe, 8, 80
Day 2: Sam, 10, 90
Day 3: Bill, 5, 40
Day 4: Bob, 8, 40
Day 5: Sue, 2, 50
most of the applications that I build are Create, Read, Update and Delete type applications that don't really need arrays so I have almost no experience with either.
VB
'
Dim iDays As Integer = NumberDaysPerMonth(Date.Now)
Dim DayNumber(iDays) As Integer
[code]....
I have a form that allows users to select file and then it reads the contents, parses the data and then executes a sql insert statement to add it to a database. What I am having issues with is showing real-time results. Currently, I have the import operation take place on the import form within the OnLoad event. The problem with this is it only shows the final results instead of the results real-time. Is there anyway to do this without creating a seperate thread and delegates?
View 1 RepliesI have just started with vb and would like to know if there is a way to input several boxes of data on one form and display individual pieces of that data on several other forms at timed events in the future?
View 1 RepliesHow can I make this program not to give me the results for the quit command input of -999 but rather just to quit without the results?
Sub Main()
Dim TempIncelsius As Double
Dim TempInput As Double
Dim Formula As Double
[CODE]...