Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 713 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Parameter var* pointer #271599
06/14/09 05:20
06/14/09 05:20
Joined: May 2008
Posts: 62
México.
F
FcoElizalde Offline OP
Junior Member
FcoElizalde  Offline OP
Junior Member
F

Joined: May 2008
Posts: 62
México.
hi all
In lite-C the manual states that to globaly modify a parameter you must declare the function with its parameters as arrays:

function do_something(var* number)
{
number[0]+=5*time_step;
}

since Im only using one value. Is there a way to declare a "variable pointer" parameter as a one value variable? To avoid declaring a vector in the function.

Last edited by FcoElizalde; 06/19/09 15:43.
Re: Parameter var* pointer [Re: FcoElizalde] #273073
06/21/09 09:36
06/21/09 09:36
Joined: Feb 2009
Posts: 52
Rohiaw Offline
Junior Member
Rohiaw  Offline
Junior Member

Joined: Feb 2009
Posts: 52
i dont think its possible ... not it lite-c anyway.
Come to think of it, i dont think it can be done in C-Script either

Last edited by Rohiaw; 06/21/09 09:37.
Re: Parameter var* pointer [Re: Rohiaw] #273080
06/21/09 10:44
06/21/09 10:44
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
This is as close as you can get in Lite-C. (not possible in C-script AFAIK)

Code:
function do_something(var* number)
{
   *number += 5 * time_step;
}

Also, when using it THIS way, its called a var POINTER, not a var array.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1