Jump to content
  • Advertisement
Sign in to follow this  
Steve00000

ByRef Keyword

This topic is 3531 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
Advertisement
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
thx i'll try that out, ummm while we're here is there still a function called BltFast in directx 9? or is there anything similar? im kinda in need of some blitting powers.

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!