AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 09.09.2021, 22:13   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
d365technext: Pass By Reference and Pass By Value
Источник: https://d365technext.blogspot.com/20...Reference.html
==============



Difference Between Pass By Reference And Pass By Value?




Pass By Reference:

In Pass by reference address of the variable is passed to a function. Whatever changes made to the formal parameter will affect the actual parameters
  • The same memory location is used for both variables. (Formal and Actual)
  • It is useful when you are required to return more than 1 value.
Pass By Value:
  • In this method value of the variable is passed. Changes made to formal will not affect the actual parameters.
  • Different memory locations will be created for both variables.
  • Here there will be a temporary variable created in the function stack that does not affect the original variable.
In the case of pass-by value, the change in the sub-function will not cause any change in the main function whereas in pass-by-reference the change in the sub-function will change the value in the main function.

Pass by value sends a COPY of the data stored in the variable you specify, pass by reference sends a direct link to the variable itself. So if you pass a variable by reference and then change the variable inside the block you passed it into, the original variable will be changed. If you simply pass by the value, the original variable will not be able to be changed by the block you passed it into but you will get a copy of whatever it contained at the time of the call.



Источник: https://d365technext.blogspot.com/20...Reference.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
crmtipoftheday: Tip #1381: Fixed reference entity in Power Automate Blog bot Dynamics CRM: Blogs 0 08.09.2020 23:14
Navigate Into Success: Some tips and hints about temporary tables Blog bot Dynamics CRM: Blogs 0 01.11.2012 14:26
X++: X++ Arrays Behave Differently in .NET CIL, in Dynamics AX 2012 Blog bot DAX Blogs 0 17.09.2012 23:11
DeniZone: Pass by reference vs. pass by value Blog bot DAX Blogs 0 24.11.2009 22:06
wiki.dynamicsbook: Changes Made in Navision Attain 301 Blog bot Dynamics CRM: Blogs 0 19.08.2008 13:44

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 20:17.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.