Register | Login
Forum Index > Bugs and Fixes > expr ? : error
Author Message
Pages: 1
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[1640] expr ? : error - posted: 2015-02-06 21:11:31

there is error in ? : expr , try compile this
Code:
program PE32_CUI 'test application';

#include 'platform_def.zir';
#include 'console.zir';

function abs(int32 n)
{  
   eax = (n >= 0) ? n : -n;
}

edx = abs(100);
print('Number: ', [dword]edx ,'\r\n');

wait_key();
ExitProcess(0);


http://www.freewebs.com/ogremagic/index.htm
Admin
Site Admin

avatar

(send private message)

Posts: 932
Topics: 54

Location:
OverHertz Studio
[1647] - posted: 2015-02-07 17:08:10
I have added support for this for next release. Thanks.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[1654] - posted: 2015-02-08 17:53:54

ok this work
Code:
 eax = (n >= 0) ? n : -n;


but why this not
Code:
  return (n >= 0) ? n : -n;


what came after '=' or 'return; is supposed to be expression pares.


http://www.freewebs.com/ogremagic/index.htm
Admin
Site Admin

avatar

(send private message)

Posts: 932
Topics: 54

Location:
OverHertz Studio
[1655] - posted: 2015-02-08 19:26:20
Added support for this, thanks for request, it was a good idea smile

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Pages: 1
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 3 user(s) online. 0 member(s) and 3 guest(s)
Most users ever online was 999, May 11, 2018, 10:01 am.


Statistics:
Threads: 224 | Posts: 1847 | Members: 50 | Active Members: 50
Welcome to our newest member, NobodyAtWork
const Copyright = '2011-2021 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd