Re: [fpc-pascal] Open vs dynamic arrays

2012-04-22 Thread Jonas Maebe
On 22 Apr 2012, at 12:54, Mark Morgan Lloyd wrote: > you quite simply can't do that when there isn't an explicit index range since > your attempt to define an open array is interpreted as a dynamic array. Yes. The reason is that you can't declare variables whose type is "open array". In fact,

Re: [fpc-pascal] Open vs dynamic arrays

2012-04-22 Thread Mark Morgan Lloyd
Michael Van Canneyt wrote: On Sun, 22 Apr 2012, Mark Morgan Lloyd wrote: cobines wrote: 2012/4/22 Mark Morgan Lloyd : but I'm not sure why that works when it didn't earlier (i.e. before I'd started using array of const). You said you used DbgArray= array of integer then I assume this decl

Re: [fpc-pascal] Open vs dynamic arrays

2012-04-22 Thread Michael Van Canneyt
On Sun, 22 Apr 2012, Mark Morgan Lloyd wrote: cobines wrote: 2012/4/22 Mark Morgan Lloyd : but I'm not sure why that works when it didn't earlier (i.e. before I'd started using array of const). You said you used DbgArray= array of integer then I assume this declaration? procedure ClrDebu

Re: [fpc-pascal] Open vs dynamic arrays

2012-04-22 Thread Mark Morgan Lloyd
cobines wrote: 2012/4/22 Mark Morgan Lloyd : but I'm not sure why that works when it didn't earlier (i.e. before I'd started using array of const). You said you used DbgArray= array of integer then I assume this declaration? procedure ClrDebug(const panels: DbgArray); If so the parameter is

Re: [fpc-pascal] Open vs dynamic arrays

2012-04-22 Thread cobines
2012/4/22 Mark Morgan Lloyd : > but I'm not sure why that works when it > didn't earlier (i.e. before I'd started using array of const). You said you used DbgArray= array of integer then I assume this declaration? procedure ClrDebug(const panels: DbgArray); If so the parameter is a dynamic arra

Re: [fpc-pascal] Open vs dynamic arrays

2012-04-22 Thread Mark Morgan Lloyd
cobines wrote: ClrDebug(panels[i]) calls itself again and not procedure ClrDebug(panel: integer)... So stack overflow happens. If you need it only for integers then declare it as: procedure ClrDebug(const panels: array of integer) Thanks. Making sure it couldn't recurse fixes half the probl

Re: [fpc-pascal] Open vs dynamic arrays

2012-04-22 Thread cobines
ClrDebug(panels[i]) calls itself again and not procedure ClrDebug(panel: integer)... So stack overflow happens. If you need it only for integers then declare it as: procedure ClrDebug(const panels: array of integer) -- cobines ___ fpc-pascal maillist