Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7069799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:29:23+00:00 2026-05-28T05:29:23+00:00

Can a function return a value byref instead of the default byval? That is

  • 0

Can a function return a value byref instead of the default byval? That is to say, allow me to directly edit the variable that it is retrieving instead of just giving me a copy of that variable.

Right now I’m trying to write a function that will return, based on what the user has selected through a combobox, a particular setting (eg. My.Settings.somethingHere). I then want to be able to edit the setting directly through just calling the function. Is that at all possible?

private function myFunction() as byte
  select case comboBox1.text
     case "a"
       return my.settings.a
     case "b"
       return my.settings.b
  end select
end function

private sub something()
  myFunction() -= 1
end sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:29:24+00:00Added an answer on May 28, 2026 at 5:29 am

    Function can’t return reference of byte instead you may create property (Writable) to assign value.

     Public WriteOnly Property Change As SByte
            Set(value As SByte)
                Select Case comboBox1.text
                    Case "a"
                        My.Settings.a = value
                    Case "b"
                        My.Settings.b = value
                End Select
            End Set
     End Property
    

    and assign value to Change property,

    private sub something()
      Change -= 1
    end sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can a function return more than one value directly (i.e., without returning in parameters
I know you can assign a function's return value to a variable and use
In order to return a value from a VB.NET function one can assign a
I'm trying to return a value from (transport) to the calling function, but can't
I need a function that can return the difference between the below two dates
I am getting this error: Fatal error: Can't use function return value in write
Can someone tell me how to return the value of status as the function's
It's pretty simple. There's a c++ function that uses ByRef parameters to return three
I got the error Can't use function return value in write context when trying
In Jquery Ajax ,Can we get response value as corresponding function return value checkSucess

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.