Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 14:34 11 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Should this create an error

Author Message
Quazee137

Guru

Joined: 07/08/2016
Location: United States
Posts: 600
Posted: 11:59am 15 Jun 2018
Copy link to clipboard 
Print this post



'Testing.bas

abcds
abcdr
abcdc

x=MYS("a1,b,c,d4,e5,cats,z33,a1,b,j,k")
print x

x=MYR
print x

x=MYC
print x

end

sub abcds
print "abcds"
end sub

sub abcdr
print "abcdr"
end sub

sub abcdc
print "abcdc"
end sub

function mys(a$)
print "mys ",a$
mys=1
end function

function myr
print "myr "
myr=3
end function

function myc
print "myc "
myc=7
end function



the output I get

> run
abcds
abcdr
abcdc
mys a1,b,c,d4,e5,cats,z33,a1,b,j,k
1
[10] x=MYR
Error: A sub/fun has the same name: MYR
>


The sub's get by but the functions do not ???

Shouldn't this work ??


Thanks
Quazee

 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1671
Posted: 12:52pm 15 Jun 2018
Copy link to clipboard 
Print this post

It seems functions require a pair of brackets ...




x=MYR()
Print x

x = myc()
Print x


'


'

Function Myr()
Print "myr "
myr=3
End Function

Function myc()
Print "myc "
myc=7
End Function



Regards
Michael
causality ≠ correlation ≠ coincidence
 
Quazee137

Guru

Joined: 07/08/2016
Location: United States
Posts: 600
Posted: 01:59pm 15 Jun 2018
Copy link to clipboard 
Print this post


Thanks did not know the function had to have the brackets.
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025