Getting Back Values From A Function?

Feb 17, 2009

I know that if you declare a function as a data type you can return a value, but my question is, is there a way to get back other values from a function without declaring it as an arraylist? For example, if you made a GetValues function, is there a way to get a value by using something like GetValues.A or GetValuesB?

View 3 Replies


ADVERTISEMENT

VS 2005 Variant - Values Coming Back From The Function Is Not Getting Converted To Object Type Properly

Jun 8, 2011

I have some ActiveX that was written for VB6. They all seem to return Variant types. Ex.

[Code]....

In this case the GetPosition control is returning a robot axis position. It looks to me like the values coming back from the function is not getting converted to object type properly.

View 2 Replies

Passing Back Lisbox Values When Going Back To Previous Page?

Jul 23, 2009

I have a search page with a couple of pulldowns. Dependig on the values of them I show a grid matching the searched criteria, basically a table with links the user can navigate to. My problem comes when the user wants to navigate back. At the moment I have a "Back" button which simply redirects the user to the initial search page. I think it would be a good improvement to have the values of the pulldowns filled in with the values the user selected, this way when he presses the "Back" button he would not have to restart the whole search process again.

View 5 Replies

Ado.net - Execute A Stored Function In Oracle Or Sql - Adding The Parameter Values Of The Function

Dec 13, 2011

I need to execute a stored function in oracle or sql through vb.net. I created a command object. Depending on the database type(oracle or SQL) i am preparing the Command text as Select functionName(?,?,?,?,?,?,?,?) from dual; (For Oracle) Adding the parameter values of the function. Now performing the ExecuteScalar which is not working saying invalid parameter. This works with ODBC connection string. But ODBC doesn't with 64bit. My Requirement: Code should execute a user defined stored procedure by taking the values at runtime.

View 1 Replies

Hit The Submit Button The Values All Go Back To 0?

Dec 12, 2011

Using the following code, every time I hit the submit button the values all go back to 0

If txtBedrooms.Text = String.Empty Then
MessageBox.Show("Please enter a bedroom 0 or greater")
Exit Sub
ElseIf Not IsNumeric(txtBedrooms.Text) Then
MessageBox.Show("Please enter a bedroom 0 or greater")

[Code]...

View 2 Replies

Pass Values Back And Forth Appdomains?

Aug 9, 2009

I have the following [code]...

I thought make this would make my ada.myString have "working!" on the main appdomain, but it doesn't. I thought that by inhering from MarshalByRefObject any changes made on the 2nd appdomain would reflect also in the original one(I thought this would be just a proxy to the real object on the main appdomain!)?

View 2 Replies

Passing Values Back From Threads

May 8, 2009

Can anyone give me the best method of passing back a value from a Thread?I have some procedures that I have set up as threads that I'm starting at the same time.My main function then waits until the threads are done and I'm needing to get back some values that the threads have created.Is there a better way to get these values back rather than just having them set a global variable with the returned value? Also, what is the proper way to wait for a thread to to be completed?I've just got a loop waiting for the Thread. Thread State property to not be in the Running state.So if there is a more proper way to wait for the thread to end I would be interested in knowing it.

View 7 Replies

Get Distinct Values And Converting Back Into DataTable?

Mar 14, 2012

I have a "result" which is DataTable and I like to get the x distinct values(City) and convert it back to DataTable how do I do this the code below gives me an error

Dim query = (From x In results.AsEnumerable()
Select (x.Field(Of String)("City"))).Distinct().CopyToDataTable()

so what I want is records of distinct cities I can get that but the problem I am having is converting it back to Datable.

Edited:I am using "where" in this statement and it does convert to Table(works fine) but not on "select"

Dim results = (From myRow In ds.Tables(1).AsEnumerable()
Where (myRow.Field(Of String)("xxxx") = xxxx)
Select myRow).Distinct().CopyToDataTable()

View 1 Replies

Javascript - Writing Back A Function Through Response.Write()?

Apr 12, 2012

I am trying to return a javascript function using response.write in an aspx page. The problem is that the function i am returning has lots of quotes and they are conflicting with the repsonse.write syntax. Here is a sample code:

Response.Write(" If hello.StartsWith("H", StringComparison.InvariantCultureIgnoreCase) OrElse hello.StartsWith("W", System.StringComparison.InvariantCultureIgnoreCase) Then")

This is giving me a problem as the quotes inside are cutting off the response early. Is there a better way to do this?

View 4 Replies

Passing Array Form C++ DLL To VB6 Through Call Back Function?

Sep 6, 2005

I need to pass an uint8 array from C++ DLL to VB6 application but I receive always following error: "subscript out of range" if I try to work with the array 'pabyData' in my VB6 procedure. The C procedure is: typedef void (__stdcall *FUNCPTR2SendData) (const uint8_t* pabyData, uint16_t wDataLength); void SendData(const uint8_t* pabyData, uint16_twDataLength) { FUNCPTR2SendData vbFunc; vbFunc = (FUNCPTR2SendData) ptCBFPointers->p2NewDirectDataSMSEvnt; // ptCBFPointers are call back pointers, where is saved the call back address of VB6 functions vbFunc(pabyData, wDataLength); } The VB6 procedure is: Public Sub SendData(ByRef pabyData() As Byte, ByVal wDataLength As Integer

View 2 Replies

Locking Form Values Back To An Active Grid Row

Jun 24, 2011

I have an infratistics grid that when I click on a row, the activerow gets set, then I click a button that will open a terminal form and ssh to an IP address in one of the activerow cells. It's not a problem until I connect to another row afterwards and it resets the activerow causing both forms to refer back to the latest activerow which would only be correct for the latest form opened. The problem then is that the terminal form refers back to the activerow cells for various updates. From my main form where the grid is, I open a new frmWodTelnet form to connect to the IP like this: [Code]

I haven't actually tried this yet, can't until next week just trying to get a grasp on how best to proceed. Does this look like it might work out for what I need, to lock the form values back to the original row until the form is closed? Or is there a better option I should be looking at.

View 4 Replies

Reading SQL Select Values Back Into Local Variables?

Apr 20, 2010

I as part of the support VB code for a larger ASP project, I need to read back the existing data from an Access database, to see if user has changed a value.

I'm reading the existing data back into a DataView using the following function:

Public Shared Function GetPolicyStatus(ByVal intPolicyID As Integer) As DataView
Dim strConString As String
Dim conMyData As OleDbConnection

[Code]....

View 4 Replies

IsDate Function Giving Back True Value When Expecting False?

Jun 22, 2010

I am using MS Visual Studio 2205 Version 8.0.50727.42 and MS.Net Framework Version 2.0.50727 SP2 I created a form that requires the user to enter a date into the textbox.I then use the IsDate function to check if the entry is a valid date. IF Not IsDate(fieldname) then send message back to user on form, otherwise continue.If something like this is enterred - 06/090/10 - It passes the IsDate question and of course fails at the database level when inserting to a datetime field. Although there is a three character day, it still passes.

View 4 Replies

Make A Certian Function That Will Fade Out [make A Black Screen That Fades Out For 2 Seconds] Then Come Back?

Oct 12, 2010

Can I make a certian function that will fade out [make a black screen that fades out for 2 seconds], then come back? Is that possible? ON A FORM.

View 3 Replies

VB 2005 Program Run A Function Back In The Original VB6 Program

Jan 6, 2011

I have a vb6 program which shells and runs a Vb 2005 program, I would like to be able from that VB 2005 program run a function back in the original VB6 program which called it. Callback?

View 1 Replies

How To Get 2 Return Values In One Function

Mar 26, 2012

i want to get two output values in one Function is't possible ?i am just using String data type and split the values.but have any other easy way to get two output values actually i want to checking a folder how many jpg files are Horizontal and vertical [code]finally i split the values with "|" character.have any other options to get two values as separate in one functions.i have no moew idea about Dictionary,

View 2 Replies

Return Two Values From The Same Function?

Feb 3, 2010

[size="5"]How can I return two values from the same function?? I need to return an arraylist and an integer...the arraylist is already returning now i need to add the integer

View 3 Replies

Returning One Or More Values From A Function?

Apr 20, 2010

Is it possible to return more than one value from a function? Like two integers, or an integer and a boolean, or any other data type combination. I understand I could use a sub and set these values in a variable but I was wondering if I could avoid declaring more variables by using a function.

View 28 Replies

Sub Variable Values Available To A Function?

Jul 7, 2011

If I have a private sub and I call a function from within that sub, will the variable values in the sub be available to the function?

View 4 Replies

Accessing Global Function / Values?

Jun 1, 2009

m using a public variable called globalquery & a global function retriveToDataGrid() it works perfectly fine under same class /form ..... but when i try to access it from a different form , it gives no error and nothing happens

Public Sub retriveDataToDataGrid()
Try
Dim connStr As String = "Database=shahopticals;" & _
"Data Source=localhost;" & _

[code]....

View 16 Replies

Function Is Not Returning Correct Values

Jun 18, 2009

Ok simply my code doesnt want to output the correct number. I'm working on the project euler probems to expand my knowledge in VB.net and the current question I am working on is asking to work with triangle numbers. while researching I found that a triangle number can be calculated by using the formula:

[Code]....

View 5 Replies

Recursive Function Using 3 Variables With 3 Different Values

Feb 14, 2011

I have 3 variables. Lets call it "a", "b" and "c". These 3 variables can "independently" have 3 different values. Lets say: "1", "6" and "10". when you think of them as combination; there are (3^3) 27 combinations. I am told that it can be done through the recursive functions. However i am not a good developer to handle with that. Would u please help me?

- 3 variables and 3 different values are simplified. In fact; the numbers of variables and different values can vary.

- i know only the language, visual basic in .net; please don't answer in other coding languages.

additional note: i am going to put the these combinations in the string format into a collection.. for example "1;1;1", "1;6;1", "1;6;10".. and so on..

View 7 Replies

Return Multiple Values From A Function?

Mar 30, 2011

Is it possible to make a function that returns both a datatable AND a list(of custom class) at the same?In my GUI layer, the main form (the application is MDI) calls this function and it has to fill the datagrid on one of its child forms and it also has to fill lot of other child forms with various information that is calculated from my custom class properties.Both the datatable and the class properties are created from the same external database and that's why I don't want to have two separate functions.

View 3 Replies

Return Multiple Values From Function?

Mar 15, 2011

I have created a function that takes a Car Registation as its argument and I want it to return 3 values (Make, Model, Price and of course True).The code itself works fine (it returning each Individual value but can't find a way to get ALL of them from 1 function) However I need to actually return all 3 values, and I cannot see how to do this with a simple function.

View 8 Replies

Returning Multiple Values From Function

Mar 17, 2009

I am working on a project I would like to use a function in a class I created to return multiple values in order to populate a listbox. I wanted to use a do until loop to achieve this. I will just post a simplified example of what I am doing :

Public Function Listboxfiller
Dim astring As String = "This is a string"
Dim Counter as integer = 0
Do until Counter = 5
return astring
Counter += 1
Loop

Then on the form I would do something like :
lstListbox.Items.Add(Myclass.Listboxfiller)

What happens right now is that the listbox only gets the first value, when I ran through in debug mode I found the loop only runs once, even though it should go multiple times.

View 4 Replies

Values Reverting After Function Call

Jun 16, 2009

I have two files. My form and a module with helper functions and the definition for a structure. For some reason, when I call finish_up, which should calculate how much freespace a disk has, the values just revert to their original bytes value. However, if I put a msgbox inside the function, the correct information is displayed. Just not once it goes back to the form.

Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Disks As New List(Of DiskData)
Search_Disks(Disks)
Finish_Up(Disks)
For Each x As DiskData In Disks
[Code] .....

The finish_up sub should go through each diskdata structure, find if it isready, calculate freespace and size down to their proper amounts and then just send it back. I don't understand where the problem is.

View 2 Replies

VS 2008 Function And Listview Values?

Sep 16, 2009

I can't seem to see a solution to this problem, i have this function:

vb.net
Function functionDisplayLoggedInAccountData(ByVal HTML As String)
Dim testStr As String = HTML

[code].....

View 2 Replies

VS 2008 Having A Function Return Two Values

Aug 19, 2009

I'm having trouble with a function returning two values. Each value contains a string, how can I return these values and have each one of them be stored in one independent variable. [code] I'm trying to return the hashed text with the salt and the generated salt, how can I do this?

View 18 Replies

VS 2010 How To Get 2 Return Values In One Function

Mar 26, 2012

i want to get two output values in one Function is't possible ?.i am just using String data type and split the values.but have any other easy way to get two output values

View 1 Replies

Back To The Previous Page On Click Of Custom Back Button?

Aug 25, 2010

I am using an image button and on click of it i want to go to visited page.Now i am using - Response.Redirect(Request.UrlReferrer.ToString()),It is going to previous page, but when i am in a page of some user details where the link is looks like - users.aspx?userid=25 and i visit some other page and click back(image button) i want to see the same userdetail page. How to track that.

View 2 Replies







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