• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 8:29pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 8:29pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

MQL Help: Convert indi ADX to run on Array 2 replies

Two Dimensional Array vs One Dimensional Array 13 replies

External Array Resize? 0 replies

Calculate Stochastic Formula on a array (non indicator buffer array) 2 replies

mql Q : how to use cci array? 4 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 2
Attachments: MQL Help : Array resize -> Access violation write to...
Exit Attachments
Tags: MQL Help : Array resize -> Access violation write to...
Cancel

MQL Help : Array resize -> Access violation write to...

  • Post #1
  • Quote
  • First Post: Aug 17, 2015 6:57pm Aug 17, 2015 6:57pm
  •  jmmac
  • | Joined Jun 2007 | Status: Member | 75 Posts
Hi, the following test code crashes with the message:

2015.08.17 23:21:09.237 Access violation write to 0x920E3DA8 in 'C:\Users\Sabre\AppData\Roaming\MetaQuotes\Terminal\1DAFD9A7C67DC84FE37EAA1FC1E5CF75\MQL4\Experts\array_test.ex4'


Inserted Code
int OnInit() {
    float A[][1][1][1];
    
    ArraySetAsSeries(A, false);
    ArrayResize(A, 20);
    ArraySetAsSeries(A, true);
        
    A[0][0][0][0] = 0;
    
    return(1);
}
 
 
void OnDeinit(const int reason) {}
void OnTick() {}



If I comment line ArraySetAsSeries(A, false); it works. And if I use a 3 dimension array it works.
Do you know what the problem is? Thank you.

Jaime
Attached File(s)
File Type: ex4 array_test.ex4   4 KB | 130 downloads
File Type: mq4 array_test.mq4   < 1 KB | 152 downloads
  • Post #2
  • Quote
  • Aug 18, 2015 9:21am Aug 18, 2015 9:21am
  •  broketrader
  • Joined Oct 2012 | Status: Beginnner (D) | 1,650 Posts
The AS_SERIES flag ( call to ArraySetAsSeries) can't be set for multi-dimensional arrays or static arrays.

Maybe that's your problem.
Simplicity is the Ultimate Sophistication.
 
 
  • Post #3
  • Quote
  • Last Post: Aug 18, 2015 10:06am Aug 18, 2015 10:06am
  •  jmmac
  • | Joined Jun 2007 | Status: Member | 75 Posts
Quoting broketrader
Disliked
The AS_SERIES flag ( call to ArraySetAsSeries) can't be set for multi-dimensional arrays or static arrays. Maybe that's your problem.
Ignored
Probably that's the problem.
Still, If I use an array with 2 or 3 dimensions, it seems to work and the debugger shows the "S" flag in the array after ArraySetAsSeries(buffer, true); ...
 
 
  • Platform Tech
  • /
  • MQL Help : Array resize -> Access violation write to...
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023