[futurebasic] Re: [FB] [FB4] pointer to a FN

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2005 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Tue, 4 Jan 2005 13:00:38 -0500
On Tuesday, January 4, 2005, at 09:44  AM, gaspren@... wrote:

> why the result is not the same ? i can not understand this

Probably because you are printing the addresses within a local Fn and 
are slave to a transient stack/heap situation...for your pointers to 
remain constant you will likely need a global or improved Def situation 
(Jay Reeve and Robert Purves turf)

Try this and note the different results...

  '-----------------------------------------------------------
begin globals
dim gFn1 as ptr
dim gFn2 as ptr
end globals

def fn fun1
def fn fun2

gFn1 = @Fn Fun1
gFn2 = @Fn Fun2

window#1

local fn fun1
print (@fn fun1),gFn1,gFn2

end fn


local fn fun2
print (@fn fun1),gFn1,gFn2

end fn



print (@fn fun1),gFn1,gFn2
print (@fn fun2),gFn1,gFn2


fn fun1
fn fun2

print "is it the same number ?"

do
handleevents
until 0
'-----------------------------------------------------------