Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Compile problem - Incorrect Number Of Paremeters

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
syndetic1

Bascom Member



Joined: 02 Jan 2007
Posts: 48

blank.gif
PostPosted: Thu Feb 25, 2021 12:09 am    Post subject: Compile problem - Incorrect Number Of Paremeters Reply with quote

When I try to compile the code below I get this error
Error : 130 Line : 19 Incorrect number of parameters. The number of parameters must be [ 3] , in File : "

As far as I can see I have 3 parameters and yet the compiler tells me I need 3.
I have tried putting byref in front of each of them and that does not work.




Code:

$regfile = "m128def.dat"
$sim                    ' Comment this out for real program
Dim p as byte
p=10
Dim  A as string * 16
A = "default string"
Dim B as string * 16
B = "123456789012345"
Declare sub read_token(pointer As byte, result As String, Abc As String)

sub read_token(pointer As byte, result As String, Abc As String)
   pointer = 2
   result  = "im changed"
   Abc = "changed too"
end sub


read_token(p, B , A)    ' <-----THIS LINE COMPILE ERROR
Print p
Print B
Print A

loop_forever:



goto loop_forever
end
 


(BASCOM-AVR version : 2.0.8.3 )
Back to top
View user's profile
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 1934

blank.gif
PostPosted: Thu Feb 25, 2021 1:29 am    Post subject: Reply with quote

Remove the braces.
Only functions are called with braces, sub calls go without.
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 733

poland.gif
PostPosted: Thu Feb 25, 2021 7:57 am    Post subject: Reply with quote

Or simply...
Code:
Call Read_token(p , B , A)  

will fix it too.
Back to top
View user's profile Visit poster's website
syndetic1

Bascom Member



Joined: 02 Jan 2007
Posts: 48

blank.gif
PostPosted: Thu Feb 25, 2021 11:08 pm    Post subject: Solved - Thank you Reply with quote

Thanks guys - greatly appreciated.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum