how to get NIL as a result of a command?

Find quick help here to get you started with Hollywood
Post Reply
peceha
Posts: 111
Joined: Tue Dec 13, 2016 8:39 am
Location: Poland

how to get NIL as a result of a command?

Post by peceha »

Hi,

I'm trying to find a command which can give me NIL as a result.
So far I have found:

Code: Select all

rawGet()
but it doesn't help too much.

I would like to get a NIL instead of 0 from something like this:

Code: Select all

(6<0)
so I thought there could be a command where I can pass this as a argument and get my NIL :)

I want to replace some IFs (a lot) with just comparison to speed up things - unfortunately the result I need is: NIL or something else (that something else means: 1, 1000, "string" or even 0)

example IF to be replaced (if condition is met , the variable "r" is set to something otherwise it is NIL (not 0))

Code: Select all

IF a>0 AND NOT RAWGET(t,0) THEN r=1
Thanks
peceha
Posts: 111
Joined: Tue Dec 13, 2016 8:39 am
Location: Poland

Re: how to get NIL as a result of a command?

Post by peceha »

EDIT
the condition should look like this:

Code: Select all

IF a>0 AND NOT HAVEITEM(t,0) THEN r=1
and I wanted to replace it with:

Code: Select all

r=a>0 and RAWGET(t,0)
but this will not work when a<0 ( the result in that case is 0 - I need NIL )
peceha
Posts: 111
Joined: Tue Dec 13, 2016 8:39 am
Location: Poland

Re: how to get NIL as a result of a command?

Post by peceha »

Hi,

sometimes I surprise myself :)
Today I just figured out what I couldn't yesterday:
That's the substitute for my IF statement

Code: Select all

var=(a>0 And RawGet(t,0)) Or RawGet(t,0)
peceha
Posts: 111
Joined: Tue Dec 13, 2016 8:39 am
Location: Poland

Re: how to get NIL as a result of a command?

Post by peceha »

ups, sorry, wrong answer :(
Post Reply