Forex Forum - EarnForex
Serving Traders Since 2005
 

Go Back   Forex Forum - EarnForex > MetaTrader > MetaTrader 5

MetaTrader 5 MT5 is already out of its beta stage, but the development is ongoing. Some brokers already offer real accounts and the interest of traders is growing. You can discuss anything related to MetaTrader 5 in this forum.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 18th October 2011, 02:55
Default Avatar
Senior Member
 
Join Date: Aug 2011
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Default array of stucts

can I do this?

when I run it, I get array out of range.

MQL5 Code:
struct some_info
{
   double ari[300];
   double val;
};


some_info ch[];

ch[x-1].ari[t] = NormalizeDouble(valu, _Digits);
Reply With Quote
  #2 (permalink)  
Old 18th October 2011, 08:17
Enivid's Avatar
Administrator
 
Join Date: Nov 2008
Posts: 1,542
Thanks: 18
Thanked 20 Times in 16 Posts
Default

There's no problem in doing that, but you have to use ArrayResize() to set size for ch[] and make sure that x-1 falls into that range. t should also be >= 0 and < 300.
__________________
Please, read the Forum Rules and the Signature Rules to avoid termination of your account.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
series array by time samjesse MetaTrader 5 1 3rd October 2011 07:28
array pupulating samjesse MetaTrader 5 3 12th September 2011 10:08
High Array max samjesse MetaTrader 5 1 5th September 2011 08:22


All times are GMT. The time now is 10:51.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Inactive Reminders By Icora Web Design

SEO by vBSEO 3.3.2