It is currently Sat May 25, 2013 11:29 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Array as argument to procedure syntax error
PostPosted: Thu Jul 05, 2012 2:22 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Sep 10, 2011 8:25 pm
Posts: 206
Location: Slovenia
Well i got this example from the pdf book and it says syntax error at line number one and i got no idea what to do:

Code:
Procedure EchoArray(MyArray.s(1)) ; These are dimensions i figured...
   For x.l = 0 To 3
      Debug MyArray(x)
   Next x
EndProcedure

Dim Countries.s(3)
Countries(0) = "England"
Countries(1) = "Northern Ireland"
Countries(2) = "Scotland"
Countries(3) = "Wales"

EchoArray(Countries())



EDIT: Figured it out in help file found that you need Array keyword, the book seems a bit outdated, which i did suspect.

Thanks for anyone who was interested to help.


Top
 Profile  
 
 Post subject: Re: Array as argument to procedure syntax error
PostPosted: Thu Jul 05, 2012 3:06 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4715
Location: Berlin - Germany
Code:
Procedure EchoArray(Array MyArray.s(1)) ; These are dimensions i figured...
   For x.l = 0 To 3
      Debug MyArray(x)
   Next x
EndProcedure

Dim Countries.s(3)
Countries(0) = "England"
Countries(1) = "Northern Ireland"
Countries(2) = "Scotland"
Countries(3) = "Wales"

EchoArray(Countries())


_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Mageia 3 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye