Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4095
Number of posts: 14004

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
irritaiting type mistmatch Posted by branzeiradu on 29 Nov 2011 at 5:08 PM
hy there!
i would be very grateful if someone could point me in the right direction with this error
i have a type mistamatch at the bottom of the program ,more exactly at
"secventa(m,secv,valori) "
the thing is usually i see this kind of errors and i understand them and i know where it should be fixed but somehow in this case i really dont see it

i had an exercise at school where i was asked to make a program wich will read asequence of sequences ended by 0 and the sequence itself by the empty seq.( ex input: 12,3,4,0,5,6,0,1,11,5,0,0->output:
12 3 4
5 6
1 11 5)
and for every sub sequence(like 12 3 4) i have to display the longest with some kind of propriety (like all numbers should be even or odd and so on,but in my case it was that every 2 numbers in a row should have at lest 2 figures in common (for ex: 1234 and 24 meet the condition given but 1234 and 48 do not)
and then to display the set of values of the numbers previously displayed.
i have attached a document with the .pas code
please someone check it out ^^



Attachment: TEST.PAS (2539 Bytes | downloaded 39 times)
Report
Re: irritaiting type mistmatch Posted by Actor on 11 Dec 2011 at 10:43 AM
secventa expects its second parameter to be a vector but you have passed it secv which is an array. Never mind that vector is an array of exactly the same type, the definition of Pascal says they are not the same thing. Your solution is to declare secv to be a vector.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.