Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'return'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 3 results

  1. Hi, I have one simple question about creating a utility library: Is it necessary to return true, and why this method must return true ? Thank you in advance
  2. Hi, I have one question about this. In the book it is written that "Doing the above would call the init() function and assign the value returned by it to the window.onload property, which is not the intent." Let's say that somewhere in JavaScript exsist the following code: var init = function() { //some code return something; } Here, a function definition is a value assigned to a variable. Now, we have: window.onload = init; and that code assigns to the onload property of the window object the value of the init variable. OK. Let's suppose that there exists the following function which does the same function init() { //some code return something; } In this case, it would be the same to use: window.onload = init; AND window.onload = init(); But in reality, this is not the case, there is no init() function, there is only init variable so it isn't the same. Am I right?
  3. Hello This is an application of page 302, my variant exercise Been trying for the last two days to get the arguments sent by an object which calls a method, to an array which is in that method, and said array only gets the first of the arguments, as if it were a single scalar variable and not an array. UPDATE Someone solved the issue for me. The problem was that I was not passing the array into the object. I have to create the array, put the elements in there and then This is the code that sends the arguments require_once 'vehicle.php'; require_once 'Motorbike.php'; $v1 = 200; // actually these are distances run at after 5, 10 and 15 seconds $v2 = 300; $v3 = 450; $suzuki = new Motorbike(); $speeds = $suzuki->speed($v1, $v2, $v3); echo "Speeds are: "; foreach($speeds as $speed) { echo $speed . "<br />"; } UPDATED $v = array(50, 20, 600); $suzuki = new Motorbike(); $speeds = $suzuki->speed($v); echo "Speeds are: "; foreach($speeds as $speed) { echo $speed . "<br />"; } <?php class Motorbike extends Vehicle { protected $bikes_speed = array(); protected $speeds = array (); public function speed($speeds){ foreach($speeds as $speed) { $this->bikes_speed[] = $speed/5; } return $this->bikes_speed; } } but this public function with argument $speeds, which is an array, is not getting the 3 values that I sent it from the code above, only the 200
×
×
  • Create New...