Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Dynamic arrays not working in free pascal 0.6.4a

dynamic array

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1 AsdasDsabas

AsdasDsabas

    CC Lurker

  • New Member
  • Pip
  • 4 posts

Posted 24 March 2014 - 10:13 AM

Dynamic arrays are not working in my free pascal. The version is 0.6.4a. If I write in something like:

 

T:array of integer;

I get an error that there should've been a "[" after the word array. I know it means that I should write in a range after the word array but I want it to be dynamic. Am I doing something wrong or it doesn't work in this version of pascal?



#2 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts

Posted 24 March 2014 - 10:34 AM

Okay, I really have to ask why you're using that version. The current version is 2.6.4. The oldest Windows version I could find is 2.2.2 from 2008.


Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#3 AsdasDsabas

AsdasDsabas

    CC Lurker

  • New Member
  • Pip
  • 4 posts

Posted 24 March 2014 - 10:58 AM

I know that. Schools in my country use the old version for some reason so I use it at home too.



#4 lespauled

lespauled

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1360 posts

Posted 24 March 2014 - 11:25 AM

It has been a (long) while since I used pascal, but I vaguely remember creating a type, like

Type
  IntegerArray = Array [1..100] of integer;

Then declare a variable of that type:

var
  myArray : IntegerArray;

See if it works, but I wouldn't bet on it.  Like I said, I haven't used pascal in well over a decade....if not 2.


My Blog: http://forum.codecal...699-blog-77241/
"Women and Music: I'm always amazed by other people's choices." - David Lee Roth

#5 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts

Posted 25 March 2014 - 05:46 AM

Here's the problem: Dynamic arrays are probably completely valid on modern versions of FreePascal (version 2), and be completely unsupported on an ancient beta version.

 

It's kind of like reading documentation on Delphi XE2 (within the last year or two), and wondering why code for it doesn't work on TurboPascal 6 (from 1991). It's not that hard to write code for a recent version of a language that will fail when going back just one version.

 

I don't know how the culture in your country's schools works, but you may want to point this issue out to your teacher. It's a free compiler, so it's not like it costs anything to stay up to date.


Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download