Sign in to follow this  

ByRef Keyword

This topic is 3315 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi everyone, i was just following a tuorial i found on gp wiki about creating a way to creat a tile map and render it, this tutorial is done in visual basic and in the turorial i noticed that as we were creating a function he used a keyword that i am unfamiliar with "ByRef", i have very little experience in visual basic as i am mainly a c++ programmer, and being that c++ programmers are very perserverent people i went out to find out what byref was "Specifies that an argument is passed in such a way that the called procedure can change the value of a variable underlying the argument in the calling code." this sounds very similar to what you can do with a function by declaring one of the arguments as a pointer and refrencing a variable to it on a call. eg. void changeNumber(int* numtochange) { *numtochange = 4; return; } /* imagine this being called elsewere from another function */ changeNumber(&variablebeingchanged); so basically what im asking here is -> is this byref keyword something like the equivalent to the example i just showed above, if not mabye someone can explain or direct me to a more indepth and helpful explanation than those ones that the visual studio documentation provides. but genereally if this is the case a yes or no would suffice, or further advice or insite is always welcome

Share this post


Link to post
Share on other sites
Perhaps a better example would be:


void changeNumber(int& numtochange)
{
numtochange = 4;
return;
}



ByRef means "pass by reference" (as opposed to ByVal which means "pass by value").

Share this post


Link to post
Share on other sites
Note that ByRef is the default method of passing parameters in vb. Use ByVal if you don't want to change the value of the arguments.

About FastBlt I don't know, maybe BitBlt or StretchBlt do what you want.

Share this post


Link to post
Share on other sites

This topic is 3315 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this