Register | Login
Forum Index > Requests and Feedback > if with function test
Author Message
Pages: 1
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[958] if with function test - posted: 2011-12-04 18:43:24

Hi Colin.

why ziron did not allow directly use a function that returns Boolean inside if block?

something like that
Code:
  if(Ziron_SetFileBuffer(handle, mem ,H_strlen(mem)) == false)
     {
         Ziron_FatalError('error when set File Buffer');
     }  


http://www.freewebs.com/ogremagic/index.htm
Molotov
Member
(send private message)

Posts: 49
Topics: 21

Location:
Behind Keyboard
[959] - posted: 2011-12-05 16:32:49
if you need that.. you could make a macro for it..

It´s as simple as that..

"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
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[960] - posted: 2011-12-05 17:40:54

yes , you can make a macro to allow useing function inside if statement , but.........

you have to create a macro for each function , and this is not prefered.


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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[963] - posted: 2011-12-05 18:31:08
I have added this in current uploaded beta, if statements will accept a function only for the first parameter (for now)

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
[965] - posted: 2011-12-05 18:50:38
if statements will accept a function only for the first parameter


sorry i did not get you , can you explain more detail please?

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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[966] - posted: 2011-12-05 18:53:55
acceptable:

Code:
if (GetMessage(@msg, 0, 0, 0)) { ...

if (myFunc() = false) { ...



not acceptable:

Code:
if (eax == myFunc()) { ...

if (myVar == myFunc()) { ...


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 8 user(s) online. 0 member(s) and 8 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