473,320 Members | 1,979 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

functions, which returns changes

Geee cannot remomber

I'd like to do this:

function blabla(var $something_to_be_updated)
{
$something_to_be_updated++;
}

but it is not var. How do I do this?

Is there a better way than a function for this?

s

Oct 26 '06 #1
3 1068
Jay
I'm not sure what you mean

$something_to_be_updated;

function update() {
global $something_to_be_updated;
$something_to_be_updated++;
}

or

function update($something_to_be_updated) {
return $something_to_be_updated++;
}
Sonnich wrote:
Geee cannot remomber

I'd like to do this:

function blabla(var $something_to_be_updated)
{
$something_to_be_updated++;
}

but it is not var. How do I do this?

Is there a better way than a function for this?

s
Oct 26 '06 #2
Note the var.
I want to pass on a variable, which is changed in the subroutine.

so::

$i = 54;
blabla($i);
$i is is now 55

S
Jay wrote:
I'm not sure what you mean

$something_to_be_updated;

function update() {
global $something_to_be_updated;
$something_to_be_updated++;
}

or

function update($something_to_be_updated) {
return $something_to_be_updated++;
}
Sonnich wrote:
Geee cannot remomber

I'd like to do this:

function blabla(var $something_to_be_updated)
{
$something_to_be_updated++;
}

but it is not var. How do I do this?

Is there a better way than a function for this?

s
Oct 26 '06 #3

Sonnich wrote:
Note the var.
I want to pass on a variable, which is changed in the subroutine.

so::

$i = 54;
blabla($i);
$i is is now 55

S
Jay wrote:
I'm not sure what you mean

$something_to_be_updated;

function update() {
global $something_to_be_updated;
$something_to_be_updated++;
}

or

function update($something_to_be_updated) {
return $something_to_be_updated++;
}
Sonnich wrote:
Geee cannot remomber
>
I'd like to do this:
>
function blabla(var $something_to_be_updated)
{
$something_to_be_updated++;
}
>
but it is not var. How do I do this?
>
Is there a better way than a function for this?
>
s
You want this:

function blabla(&$something_to_be_updated) {
$something_to_be_updated++;
}

Read this:
<http://www.php.net/manual/en/language.references.pass.php>

Oct 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Anthony Baxter | last post by:
To go along with the 2.4a3 release, here's an updated version of the decorator PEP. It describes the state of decorators as they are in 2.4a3. PEP: 318 Title: Decorators for Functions and...
6
by: Steven An | last post by:
Howdy, I need to write an update query with multiple aggregate functions. Here is an example: UPDATE t SET t.a = ( select avg(f.q) from dbo.foo f where f.p = t.y ), t.b = ( select sum(f.q)...
8
by: [RaZoR] | last post by:
hello, main script creates IE window, put an array there and then calls a child script. chils script makes an array element equal to some object and returns control to main script. then main...
5
by: Sue | last post by:
After finishing up my first quarter JavaScript on 12/12/03, I decided to improve character checking on my project. In my project I only had to do very basic validation. Therefore, I only had one...
7
by: BlueDragon | last post by:
The place where I work is moving to MS SQL Server from Lotus Notes. I have done a lot of coding in Lotus Notes, and have, I suppose, intermediate skills in basic SQL -- queries, insert, updates,...
1
by: db2sysc | last post by:
All, We have listed out the INBUILT Function differences between Sybase and DB2. Kindly provide your feedback or corrections and for CHANGES - DO WE NEED TO CODE our own UDFs?
23
by: Timothy Madden | last post by:
Hello all. I program C++ since a lot of time now and I still don't know this simple thing: what's the problem with local functions so they are not part of C++ ? There surely are many people...
11
by: Josiah Manson | last post by:
In the following program I am trying to learn how to use functional programming aspects of python, but the following program will crash, claiming that the recursion depth is too great. I am...
0
by: ddddd | last post by:
AM using the JDBC interface metho getProcedures() to get the stored procedures from the Database... Since this is common interface method am trying out with two different set of databases namely...
1
MMcCarthy
by: MMcCarthy | last post by:
Access has a number of built-in functions which can be generally used in queries or VBA code. Some of the more common ones are: Note: anything in square brackets is optional Date Functions ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.