I'm in one of those 'Can't see the wood for the trees' situations.
I ported some asm over to a Class Method and the results were as if I hadn't ported anything.
The following otherwise meaningless snippet best describes my problem.
On the face of it, it seems that Instance Variables are not keen on asm but I feel sure they would be if I knew what I was doing.
The first two asm lines are not doing what I thought they would do. Anothervariable remains at 123 instead of 999; which is what I'm after with this snippet.
The assigning of local temporary variables in the monstrosity solves the problem but I cannot believe that's what I need to do otherwise a lot of asm work is going to get throttled.
Just out of curiosity changing Anothervariable to 456 gave 456 as the outcome and that is local.
I've been reading the Help file but it doesn't give much away and Googling Instance Variables leaves a lot to be desired. Slipping an analogy twix two gobbledygook statements seems to be a lost art.
I ported some asm over to a Class Method and the results were as if I hadn't ported anything.

The following otherwise meaningless snippet best describes my problem.
On the face of it, it seems that Instance Variables are not keen on asm but I feel sure they would be if I knew what I was doing.
The first two asm lines are not doing what I thought they would do. Anothervariable remains at 123 instead of 999; which is what I'm after with this snippet.
The assigning of local temporary variables in the monstrosity solves the problem but I cannot believe that's what I need to do otherwise a lot of asm work is going to get throttled.
Just out of curiosity changing Anothervariable to 456 gave 456 as the outcome and that is local.
I've been reading the Help file but it doesn't give much away and Googling Instance Variables leaves a lot to be desired. Slipping an analogy twix two gobbledygook statements seems to be a lost art.

Code:
#Compile Exe #Dim All #Register None Class CAffair Instance Avariable, Anothervariable As Dword Class Method Create Avariable = 999 Anothervariable = 123 End Method Class Method AsmBit() ' These two lines have no effect on Anothervariable ! mov eax, Avariable ! mov Anothervariable, eax ' This monstrosity works ie Anothervariable becomes 999 ' Local TAvariable,TAnothervariable As Dword ' TAvariable = Avariable ' ! mov eax, TAvariable ' ! mov TAnothervariable, eax ' Anothervariable = TAnothervariable ' Anothervariable becomes 456 ' Anothervariable = 456 End Method Interface IAffair Inherit IUnknown Method Test As Double Me.AsmBit Method = AnotherVariable End Method End Interface End Class Function PBMain Local Whatever As IAffair Let Whatever = Class "CAffair" Print Whatever.Test ' Should be Anothervariable Waitkey$ End Function
Comment