User Defined Functions: Clarification Please

Status
Not open for further replies.

zacheisjd

Board Regular
Joined
Oct 23, 2008
Messages
50
Hello all,
I am currently studying intro to programming (using Pseudocode), and need a bit of clarification on user defined functions. The example given in my text is:
Code:
Main
   Declare LittleBox As Float
   Set LittleBox =  Cube(10)
   Write LittleBox
End Program
Function Cube(Side) as Float
   Set Cube =  Side^3
End Function

I get that line 3 calls the Cube Function and transfers the value of 10 to that function.
What I don't get is how the value of 10 is given to the variable Side. My line of thought at the moment is...
Set LittleBoxx = Cube(10) //Call Function Cube and passes value of 10 to function Cube
Set Cube = Side^3 //Cube now = 10, I don't know how Cube passes its value to Side

By the way, I am eager to learn, this example is from Prelude to Programming: Concepts and Design 4E by Venit and Drake Page 391
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Status
Not open for further replies.

Forum statistics

Threads
1,225,626
Messages
6,186,089
Members
453,336
Latest member
Excelnoob223

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top