parameter passing
Posted: Tue Jun 17, 2014 7:59 pm
I believe that there is something wrong With fnxcompiler(21.12.2013):
I do not know, the parameter passing of subroutines or/and functions
how is it done? By value, or by address in fnxbasic?
For me it caused trouble several times, and unexplained phenomena encountered.
Here an test:
[code]
`param.bas by PaPi 17-06-2014
object mainform as form
width=200
left=200
center
onmousedown=omd
showmodal
end object
sub omd(b as integer,sh as integer,u as integer,v as integer)
dim x1 as single,y1 as single,z as integer
x1=u
y1=v
z=99
print "Bad:"
wr(x1,y1,z)
print "Good:"
wr(x1,y1,88)
end sub
sub wr(x as single,y as single,k as integer)
print x,y,k
end sub
[end code]
Help me, please, Marco!
PaPi
I do not know, the parameter passing of subroutines or/and functions
how is it done? By value, or by address in fnxbasic?
For me it caused trouble several times, and unexplained phenomena encountered.
Here an test:
[code]
`param.bas by PaPi 17-06-2014
object mainform as form
width=200
left=200
center
onmousedown=omd
showmodal
end object
sub omd(b as integer,sh as integer,u as integer,v as integer)
dim x1 as single,y1 as single,z as integer
x1=u
y1=v
z=99
print "Bad:"
wr(x1,y1,z)
print "Good:"
wr(x1,y1,88)
end sub
sub wr(x as single,y as single,k as integer)
print x,y,k
end sub
[end code]
Help me, please, Marco!
PaPi