Skip to content
Low-level programming · Higher-level thinking
Login Register
Forum / Source Help

Problems using block

A community discussion post from the original code:zIRON forum.

Molotov member
Posts
49
Threads
21
Location
Behind Keyboard

Problems using block

So i have this small problem =), any help i can get is greatly appriciated

The block definition

block Tpoint {
 DWord x;
 DWord y;
}

The code

Tpoint* myPoint;

myPoint = new Tpoint;

push edi;

edi = myPoint as Tpoint;

GetCursorPos(edi);

// Do something with the position here

edi as nothing;

pop edi;

delete myPoint;

The error from compiler

Ziron Compiler 1.1.27.6
Copyright (C) 2011. OverHertz Ltd. All rights reserved.
--------------------------------------------
2011-11-22 18:23:54
--------------------------------------------

PlugSys: Emit plugin has loaded!
--------------------------------------------


[3,22]: Expected variable or local variable or local parameter but found == in [macro new]
Code: 
	$if deftype($dt) == 'int':

Press the [enter] key to exit.

"Lerning new things is what life is all about, if you are always doing the same old things day in and day out you might aswell just kill yourself." - ME d^_^b

Replies

Colin admin
Posts
928
Threads
49
Location
Bulgaria

ok that seems to be a bug i will fix for next release, for now try...

... = new sizeof Tpoint;
Molotov member
Posts
49
Threads
21
Location
Behind Keyboard

Yeah that works, new code is however

push edi;
edi = new sizeof tagPoint;
GetCursorPos(edi);
TrackPopupMenu(Menu, hmm2, edi.x, edi.y, 0, MainFRM, NULL);
pop edi;

thanks to Admin for pointing out that i should use edi directly instead, and that tagPoint existed in user32.zir d@b

"Lerning new things is what life is all about, if you are always doing the same old things day in and day out you might aswell just kill yourself." - ME d^_^b