{"id":31635,"date":"2018-03-20T18:48:13","date_gmt":"2018-03-20T18:48:13","guid":{"rendered":"http:\/\/www.oracletutoring.ca\/blog\/?p=31635"},"modified":"2018-03-20T18:48:13","modified_gmt":"2018-03-20T18:48:13","slug":"computer-science-value-parameter-vs-variable-parameter","status":"publish","type":"post","link":"https:\/\/www.oracletutoring.ca\/blog\/computer-science-value-parameter-vs-variable-parameter\/","title":{"rendered":"Computer science: value parameter vs variable parameter"},"content":{"rendered":"<h1>Tutoring computer science, the difference between variable and value parameters is interesting. The tutor illustrates it.<\/h1>\n<div style=\"font-family:monospace;font-size:130%;white-space:pre-wrap;color:brown;background-color:lavender;padding:16px\">\n<span style=\"font-size:130%\">value parameter:<\/span><\/p>\n<p>the parameter&#8217;s <em>value<\/em> is sent to the function or method, but the function can&#8217;t change the parameter itself. For instance:<\/p>\n<p>j=5<\/p>\n<p>function(value_parameter p){<\/p>\n<p>p=p+1;<\/p>\n<p>output &#8220;p=&#8221; p;<br \/>\noutput &#8220;j=&#8221; j;<br \/>\n}<\/p>\n<p>function(j);<\/p>\n<p>will give the output<\/p>\n<p>p=6<br \/>\nj=5<span style=\"color:indigo;white-space:pre-wrap\">  \/\/j is still 5<br \/>\n\n<\/div>\n<p style=\"white-space:pre-wrap\"><\/p>\n<div style=\"font-family:monospace;font-size:130%;color:lavender;background-color:brown;padding:16px;white-space:pre-wrap\">\n<span style=\"font-size:130%\">variable parameter<\/span><\/p>\n<p>the parameter itself is sent to the function. Changes made to it by the function will persist in the external program.<\/p>\n<p>j=5<\/p>\n<p>function(variable_parameter p){<\/p>\n<p>p=p+1;<\/p>\n<p>output &#8220;p=&#8221; p;<br \/>\noutput &#8220;j=&#8221; j;<br \/>\n}<\/p>\n<p>function(j);<\/p>\n<p>will give the output<\/p>\n<p>p=6<br \/>\nj=6<span style=\"color:lightgrey;white-space:pre-wrap\">  \/\/j has been changed to 6 by the function<\/span><br \/>\n\n<\/div>\n<p style=\"white-space:pre-wrap\"><\/p>\n<p>Source:<\/p>\n<p><a href=\"http:\/\/docwiki.appmethod.com\/appmethod\/1.13\/topics\/en\/Parameters_(Object_Pascal)#Value_and_Variable_Parameters\">docwiki.appmethod.com<\/a><\/p>\n<p>Jack of <a href=\"https:\/\/www.oracletutoring.ca\">Oracle Tutoring by Jack and Diane,<\/a> Campbell River, BC.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tutoring computer science, the difference between variable and value parameters is interesting. The tutor illustrates it. value parameter: the parameter&#8217;s value is sent to the function or method, but the function can&#8217;t change the parameter itself. For instance: j=5 function(value_parameter &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.oracletutoring.ca\/blog\/computer-science-value-parameter-vs-variable-parameter\/\"> <span class=\"screen-reader-text\">Computer science: value parameter vs variable parameter<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105,1],"tags":[2811],"class_list":["post-31635","post","type-post","status-publish","format-standard","hentry","category-computer-science","category-uncategorized","tag-value-parameter-vs-variable-parameter"],"_links":{"self":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/31635","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/comments?post=31635"}],"version-history":[{"count":70,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/31635\/revisions"}],"predecessor-version":[{"id":31705,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/31635\/revisions\/31705"}],"wp:attachment":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/media?parent=31635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/categories?post=31635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/tags?post=31635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}