Register | Login
Forum Index > Source Help > Problems using block
Author Message
Pages: 1
Molotov
Member
(send private message)

Posts: 49
Topics: 21

Location:
Behind Keyboard
[788] Problems using block - posted: 2011-11-22 19:18:13
So i have this small problem =), any help i can get is greatly appriciated

The block definition
Code:
block Tpoint {
 DWord x;
 DWord y;
}


The code
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
Code:
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
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[789] - posted: 2011-11-22 19:21:17
ok that seems to be a bug i will fix for next release, for now try...

Code:
... = new sizeof Tpoint;


Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Molotov
Member
(send private message)

Posts: 49
Topics: 21

Location:
Behind Keyboard
[791] - posted: 2011-11-22 19:44:49
Yeah that works, new code is however

Code:
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 smile

"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
Pages: 1
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 19 user(s) online. 0 member(s) and 19 guest(s)
Most users ever online was 1046, January 28, 2022, 2:08 pm.


Statistics:
Threads: 225 | Posts: 1848 | Members: 51 | Active Members: 51
Welcome to our newest member, yecate
const Copyright = '2011-2024 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd