How To Write A Procedure

May 3, 2011

Write a Visual Basic Console Application. Inside the main procedure call a function procedure to input and return a value for a double variable called x, the width of a right triangle. Inside the main procedure call the same function procedure a second time to get a value for a double variable called y, the height of a right triangle. From the main procedure call a function procedure which calculates and returns a value for the "hypotenuse" equal to the square root of (x squared + y squared). You will have to pass the values of x and y to this function procedure. The procedure should calculate and return a double type value. The value that is returned by this function procedure should be equal to the square root of (x squared + y squared). Also from the main procedure call a sub procedure to display the values of x, y, and the hypotenuse.

This is what I have so far..

Option Strict On
Option Explicit Off
Module Module1

[code]....

View 3 Replies


ADVERTISEMENT

Write A Procedure For Arrays?

Nov 19, 2010

i created a list of picturebox arrays in my program :

Dim MyPicArray As New List(Of PictureBox)
and i used this code to add them:
MyPicArray.Add(New PictureBox())

[Code].....

the above code works the pictures are created in the form but now i want to write events for them, for example in the 'Click' event a messagebox shows. i don't know how to write the procedure i have tried this but it didn't worked :

Private Sub MyPicArray_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyPicArray.Click
MessageBox.Show("It Works!")
End Sub

View 3 Replies

Is Write A Function Procedure That Takes An Array Of Strings

May 9, 2010

I'm a beginner and doing a review for my final...the question is-Write a Function procedure that takes an array of Strings, sorts it using Shell sort and returns the sorted array. I do not get shell sort at all.

View 3 Replies

Write A Protection Procedure Which Will Allow To Create A License Key For Users?

Apr 9, 2010

I am trying to write a protection procedure, which will allow me to create a licence key for our users. This licence key will ensure that the software can only run on the registered system, and will allow the user to access only specific areas of my program which is relevant to them.

I am thinking of using an RSA style approach to this where I want to be the only person who can create the registration keys. But I want to allow the program to be be able to decrypt the key. This is to prevent the average user from being able alter the key and remove any restrictions which are being imposed on the program by the license key.

The process that this would take is to produce a host id which has went through a series of tasks to distort the actual value from the user will return this code us, and from this host id I can then work out the original value of the code. Using these public and private keys I can then encrypt license key information.

However I would like to know how I would implement the private key encryption and key generation program in .NET, so that I can get this setup working in a manner which will allow me to generate keys and allow the program to decrypt keys.

View 8 Replies

Main Procedure Call A Sub Procedure To Display Values Of X / Y And Hypotenuse

Dec 1, 2011

The instructions are as follows:

1. Write a Visual Basic Console Application.Inside the main procedure call a function procedure to input and return a value for a double variable called x, the width of a right triangle.Inside the main procedure call the same function procedure a second time to get a value for a double variable called y, the height of a right triangle.

2. From the main procedure call a function procedure which calculates and returns a value for the hypotenuse equal to the square root of (x squared + y squared).You will have to pass the values of x and y to this function procedure.The procedure should calculate and return a double type value.The value that is returned by this function procedure should be equal to the square root of (x squared + y squared).

3. Also from the main procedure call a sub procedure to display the values of x, y, and the hypotenuse.

View 4 Replies

Wrap Blocks Into One Sub Procedure Passing Different Arrays When Procedure Is Called?

Feb 23, 2010

In a tic tac toe game I am making there are two blocks of code that are identical except that they access different arrays:[code]Arrays plyrTaken and plyrPairs are used in the first block and cmptrTaken and cmptrPairs are used in the second. Is it possible to wrap these blocks into one Sub Procedure passing the different arrays when the procedure is called?

View 5 Replies

Change GetFWT Procedure To Independant Sub Procedure?

Aug 10, 2007

Well i ran into some problems changing my getfwt to a independant sub procedure. This stuff is so confusing to me.[code]...

View 14 Replies

Procedure Or Function 'procedure Name' Display Has Too Many Arguments Specified

Mar 11, 2010

i able to get data then i click second time i got error Procedure or function "procedure name" display has too many arguments specified" why this error. [code]

View 2 Replies

Terminate Calling Procedure From The Call Up Procedure?

Nov 29, 2011

Is there a way to terminate calling procedure from the callep up procedure? I tried 'Stop' from a called up procedure in an executable; it has gone stuck; I am not able to remove it(the form) from the screen!

View 18 Replies

VS 2005 Modifying Sub Procedure To Function Procedure?

Apr 15, 2010

I finished coding an application for converting Celsius to Fahrenheit, and vice versa. I used the Sub Procedure to convert them. What I need now is to modify it. I would have to use the Function Procedure instead of my Sub Procedure.

[Code]...

View 11 Replies

Pass A Value From A Sub Procedure To A Function Procedure .... Pass The Whole Subprocedure To The Function Procedure Argument?

Mar 30, 2012

Im a student doing an assignment, how do i pass the value from a sub procedure to a function procedure....i want to pass the value from decSubtotal to a function procedure named CalculateDiscount; check out my code--

[Code]...

View 1 Replies

Call A Stored Procedure From Sql Server Which Work With A Stored Procedure

Sep 11, 2009

The store procedure which give me the information I need is:

USE [UCSMIS]
GO
SET ANSI_NULLS ON

[Code].....

When I try to add it to my report it gives an error, is it because of the temp table and how should I go about it?

View 2 Replies

Sub Procedure And A Function Procedure

May 4, 2010

I have to get a value in $.I have 2 radio buttons:

-Residential Customers
-Business Customers

I have 2 List boxes:

-Premium Channels
-Connections

I also have a total Text Box and a calculate button..My goal is to get a cost given the information from the user. the list boxes will have preassigned numbers in them..The residential Customers have to pay a $4.50 Processing fee, a Basic service fee of $30 and 5$ for ever Premium Chanel they buy. The Business Customers have to pay a processing fee of $16.50, a basic service fee of $80 for the first 10 connections (4$ for any connection after that) and 50$ per Premium Chanel (no limit)

View 1 Replies

Sql - Getting Parameter For A Stored Procedure Inside Another Stored Procedure

Aug 29, 2011

I have a stored procedure to update a table, but needs a couple of values from another table.

the first two selects get the value from the table and then are used in the update statement.

The select statments:

Select @iStatusDropDownValueID = iDropDownValueID
From DropDownValue
Inner Join DropDownValueType On DropDownValue.iDropDownValueTypeID =

[Code].....

First, the values that are retrieved by the first two select statements are always the same. So they could be passed in by the code itself. I don't know that this will speed things up at all, just make the entire stored procedure better and easier to read.

Second, if the "Value Name" should change this store procedure will break (which is possible, but not often).

I am looking for any insight into the Best Practices for this situation.

View 2 Replies

Mystream.write(t) Doesnt Work - Doesent Write Anything To My H.txt Text File

Dec 27, 2011

I have a trouble making this code work. When executed, it just creates a correct (with the correct name) file with the extension .txt but the the actual text inside .

Imports System.IO
Public Class Form1

Public mytext As String

[code]...

The strange thing is that while debugging, h, t string variables have the correct values, but somehow mystream.write(t) doesnt work (it doesent write anything to my h.txt text file...

View 5 Replies

Write And Saves It And Gets The Xbox 360 Achievement Pop Up Saying "Gotta Write This Down?

Jun 29, 2009

Ok i saw this guy on youtube that made a achievement generator for his computer. For example, he goes to notepad and write something and saves it and gets the xbox 360 achievement pop up saying "Gotta write this down" and all that. Cud this have been coded thru VB.NET or something?

View 1 Replies

Write Some Javascript Code In Response.write When SqlDataSource1_Deleted?

May 23, 2012

i have a notification j-query plugin .. i taste it in my page (working 100%)but when i want to use it in a event SqlDataSource1_Deleted with the response.write method it does not work

Protected Sub SqlDataSource1_Deleted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs) Handles SqlDataSource1.Deleted
Response.Write("<script type='text/javascript'> showNotification({message: 'This is a

[code].....

View 1 Replies

Write A Program To Write In A Xml File?

Sep 14, 2010

I want to write a program to write in an xml file in this format:

<?xml version="1.0" encoding="utf-8" ?>
- <Orders>
<Item id="1" SKU="998123" Description="Super Widget" Quantity="100" />

[Code]....

View 2 Replies

Write A Sub That Will Write To A File?

Nov 3, 2010

I'm trying to write a sub that will write to a file. here is what i have:

Public Sub LogMe(ByVal MyType As String, ByVal MyMessage As String)
Dim LogStream As FileStream 'should be at a level with enough scope for your logging

[Code]....

The problem is that this will just overwrite what is already there. I would like to have it append the EHomeLog.log every time it is called.

View 2 Replies

Using Write Start Element And Write End Element In VB For XML Code

Oct 2, 2009

I know I can create XML ouput in Example 1 as follows using the following code in Example 2. How do I create the same output in Example 3?[code...]

View 9 Replies

.net - Using A Stored Procedure

Sep 7, 2009

I want use a stored procedure in my project but I have no idea about it. Please could you tell me a little bit about how to use I can use one in my vb.net application ?

View 2 Replies

Add The Bounds In A Procedure?

Jul 9, 2009

OK. So I have a class-level array:

Dim terrain()() As Double and I want to add the bounds in a procedure:

Dim terrain()() As Double = New Double(divisions + 1)() {}I can't add the bound for the seconds dimension.

Then I want to assign a value to any element of the array inside the procedure.

terrain(0)(0) = 0.5 This gives the error: Object reference not set to an instance of an object You can see my problem. What solution can there be to this problem that involves one array.

View 6 Replies

Cannot Get Return Value From Sql Procedure

Aug 19, 2011

I have tried ADO, now I've moved to SQLClient and I still cannot retrieve the return value from my procedure.

Here is my VB code:

cmd.CommandText = "usp_executeMerge"
cmd.CommandType = CommandType.StoredProcedure
Dim retparm As New SqlClient.SqlParameter

[code]....

My mergeResults table shows the return value of 99 but I cannot get any value back to my VB program.

View 1 Replies

How Stored Procedure Run

Dec 22, 2011

I have noticed the following but unable to understand why.Whenever a procedure is called in .net it takes more time than when it is called subsequently.Even if a procedure is called after some interval it takes more time than it takes if it is called quite frequently. i am not asking about sql query or sql command. any user definded function or user defined method takes much more time to finish when it is called occasionaly. but when the same procedure is called quite often it finishes a lot faster. why?

View 1 Replies

How To Create A Procedure

Oct 24, 2010

how to create a procedure?In VB6 it was through Insert Menu > Add Procedure.Also (just out of interest) is it possible to read from a database and copy the data in to an array?I've not used Visual Express for a while and have forgotten how to do theses.

View 6 Replies

How To Loop This Procedure

Aug 5, 2010

I have been creating a little utility to generate random alpha-numeric username and password combos so I don't have to input this stuff by hand. A time saver. Whenever I clickbtnGenerate it generates a new set of random numbers, adds them where directed but only generates one ne set per click. I can't seem to figure out how to get it to loop the number of times I have typed into txttotal. So, if for example I needed 1000 uniqueusernames/passwords I'd like to, in the runtime, input "1000" into

View 2 Replies

How To Use To.Upper Procedure

Mar 16, 2010

I'm working on a project where an application requires to show 50 US state names. When User enters the abriviation in the text box, I want it to convert into Upper case. I made an attempt and coded like this:

strAbriviation = strAbriviation.ToUpper(txtAbriviation.Text)

but that didn't work !! it gives me that blue swigly line How do I fix this?

Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
Dim strAbriviation As String

[code]....

This code works fine when user enters Capital letters. It's just that i want it to work if user enters small letters.

View 17 Replies

Run A SQL Stored Procedure ?

Jan 26, 2012

I am currently building an ASPX webpage for internal use. Basically, there are two buttons on this page and I need each one to kick off a different stored procedure on our local SQLServer based on the needed task. these stored rocedures do quite a bit of work and take 3-5 minutes to finish running. In neither case do I need any kind of gridview or other output from these stored procedures, as they are simply crunching/cleaning data that will populate some tables that the user will then use to complete their task. There are also no inputs or parameters needed.

So i'm OK at ASPX and pretty good at SQL, but have no idea on the VB code behind page. This is what I have ben able to put together based on 3 days of googling. i think i am close but can't quite get across the line.

CODE:

I'm not sure if you need to see any of my ASPX or my SQL. both work fine on their own, but i am not able to get these buttons to work.

View 4 Replies

Set Variables To Nothing At End Of Procedure

Aug 24, 2011

I am wondering if I need to set my variables to Nothing at the end of a procedure or just garbage collection take care of it automatically.For example, is the code below necessary? Why or why not? [code]

View 15 Replies

Sub Procedure Using Parameters?

Mar 12, 2009

I am trying to create a DisplayAverage sub procedure that accepts 3 integer numbers as parameters. This procedure should find the average of these 3 numbers and display the numbers along with their average in the list box.

Private Sub btnAverage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAverage.Click
Dim a As Integer = CInt(txtone.Text)
Dim b As Integer = CInt(txtTwo.Text)[code].....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved