If you have a look at the following code, you will see that on the call
to the class Test, a call is made to method m1. Within this method, a
reference is made to method m2 as a parameter to ximage.
link ximage
procedure main()
local t
t := Test()
end
class Test(f1, f2)
method m1()
write("this is method 1")
write(ximage(m2))
end
method m2()
write("this is method 2")
end
initially(fl1, fl2)
f1 := fl1
f2 := fl2
m1()
end
However, the icode file produced initiates a call to m2 first which it
should not be doing. See attached Ucode file.
The output is
this is method 1
this is method 2
when it should be the first line followed by an ximage display of the m2
method.
I have come across this while in the process of converting the
regexp.icn file from the IPL to a class format file. By rewriting the
code for the procedure Re_pat1, I was able to track down that a
reference to a method was being translated to a call to that method.
I hope there is enough detail here to solve the problem.
regards
Bruce Rennie
PS. Please confirm that this is an actual error and that I have not
misinterpreted what should be happening.
link ximage
procedure main()
local t
t := Test()
end
class Test(f1, f2)
method m1()
write("this is method 1")
write(ximage(m2))
end
method m2()
write("this is method 2")
end
initially(fl1, fl2)
f1 := fl1
f2 := fl2
m1()
end
version U12.1.00
uid trial.u1-1378205111-0
record Test__state,4
0,__s
1,__m
2,f1
3,f2
record Test__methods,3
0,m1
1,m2
2,initially
impl error
link ximage.u
global 9
0,000005,main,0
1,000005,Test_m1,1
2,000005,Test_m2,1
3,000005,Test_initially,3
4,000011,Test__state,4
5,000011,Test__methods,3
6,000001,Test__oprec,0
7,000005,Test,2
8,000005,Testinitialize,0
proc main
local 0,000020,t
local 1,000000,Test
declend
filen trial.icn
line 2
colm 12
synt any
mark L1
pnull
var 0
var 1
line 4
colm 14
synt any
invoke 0
line 4
colm 7
synt any
asgn
unmark
lab L1
pnull
line 5
colm 1
synt any
pfail
end
proc Test_m1
local 0,001000,self
local 1,000000,write
local 2,000000,ximage
con
0,010000,16,164,150,151,163,040,151,163,040,155,145,164,150,157,144,040,061
declend
line 9
colm 11
synt any
mark L1
var 1
str 0
line 10
colm 14
synt any
invoke 1
unmark
lab L1
mark L2
var 1
var 2
pnull
var 0
line 11
colm 26
synt any
field m2
line 11
colm 21
synt any
invoke 1
line 11
colm 14
synt any
invoke 1
unmark
lab L2
pnull
line 12
colm 1
synt any
pfail
end
proc Test_m2
local 0,001000,self
local 1,000000,write
con
0,010000,16,164,150,151,163,040,151,163,040,155,145,164,150,157,144,040,062
declend
line 14
colm 11
synt any
mark L1
var 1
str 0
line 15
colm 14
synt any
invoke 1
unmark
lab L1
pnull
line 16
colm 1
synt any
pfail
end
proc Test_initially
local 0,001000,self
local 1,001000,fl1
local 2,001000,fl2
declend
line 18
colm 11
synt any
mark L1
pnull
pnull
var 0
line 19
colm 9
synt any
field f1
var 1
line 19
colm 12
synt any
asgn
unmark
lab L1
mark L2
pnull
pnull
var 0
line 20
colm 9
synt any
field f2
var 2
line 20
colm 12
synt any
asgn
unmark
lab L2
mark L3
pnull
var 0
line 21
colm 9
synt any
field m1
line 21
colm 12
synt any
invoke 0
unmark
lab L3
mark L4
mark L5
pnull
line 22
colm 7
synt any
pret
lab L5
synt any
pfail
unmark
lab L4
pnull
line 23
colm 1
synt any
pfail
end
proc Test
local 0,001000,fl1
local 1,001000,fl2
local 2,000020,self
local 3,000020,clone
local 4,000000,Test__oprec
local 5,000000,Testinitialize
local 6,000000,Test__state
declend
line 27
colm 11
synt any
lab L1
init L3
mark L2
line 30
colm 3
synt if
mark0
pnull
var 4
line 30
colm 6
synt any
null
unmark
var 5
line 30
colm 38
synt any
invoke 0
line 30
colm 3
synt endif
unmark
lab L2
einit L1
lab L3
mark L4
pnull
var 2
var 6
line 32
colm 23
synt any
keywd null
var 4
line 32
colm 22
synt any
invoke 2
line 32
colm 8
synt any
asgn
unmark
lab L4
mark L5
pnull
pnull
var 2
line 33
colm 7
synt any
field __s
var 2
line 33
colm 12
synt any
asgn
unmark
lab L5
mark L6
mark L7
pnull
pnull
var 2
line 34
colm 7
synt any
field __m
line 34
colm 11
synt any
field initially
var 2
var 0
var 1
line 34
colm 21
synt any
invoke 3
line 34
colm 36
synt any
esusp
goto L8
lab L7
line 34
colm 38
synt any
pfail
lab L8
unmark
lab L6
mark L9
mark L10
var 2
line 35
colm 3
synt any
pret
lab L10
synt any
pfail
unmark
lab L9
pnull
line 36
colm 1
synt any
pfail
end
proc Testinitialize
local 0,000000,Test__oprec
local 1,000000,Test__methods
local 2,000000,Test_m1
local 3,000000,Test_m2
local 4,000000,Test_initially
declend
line 38
colm 11
synt any
lab L1
init L3
mark L2
pnull
var 0
var 1
var 2
var 3
var 4
line 39
colm 39
synt any
invoke 3
line 39
colm 23
synt any
asgn
unmark
lab L2
einit L1
lab L3
line 40
colm 1
synt any
pfail
end
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Unicon-group mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unicon-group