Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Scott Burns — — source: Usenet: comp.databases.informix
Hi,
just wanted to confirm my impression that 4gl won't let you use
logical ands in select on bit fields under SE.
What we want to do is select ... where amendFlag & 0x6, that is,
when the second and third bits of amendFlag are set.
I suspect we are going to be reduced to selecting all then manually
running through each to find the one we want.
Are there easier/better ways?
--
Scott Burns
Mirrabooka Systems
Tel +61 7 3857 7899
Fax +61 7 3857 1368
You could compile in a C function:
int bitwise_and(int nargs)
{
int arg[2];
popint(&arg[2]);
popint(&arg[1]);
retint(arg[1] & arg[2]);
return(1);
}
Test 4GL module:
MAIN
DEFINE x INTEGER
LET x = bitwise_and(ARG_VAL(1),ARG_VAL(2))
DISPLAY x
END MAIN
Compile command:
c4gl -o bitwise.4ge bitwise.4gl bitwise_and.c
--
Regards,
Doug Lawry
www.douglawry.webhop.org
"Scott Burns" <scott@mirrabooka.com> wrote:
> Hi,
> just wanted to confirm my impression that 4gl won't let you use
> logical ands in select on bit fields under SE.
>
> What we want to do is select ... where amendFlag & 0x6, that is,
> when the second and third bits of amendFlag are set.
>
> I suspect we are going to be reduced to selecting all then manually
> running through each to find the one we want.
>
> Are there easier/better ways?
>
> --
> Scott Burns
> Mirrabooka Systems
>
> Tel +61 7 3857 7899
> Fax +61 7 3857 1368
↪ replying to Scott Burns
Roland Wintgen — — source: Usenet: comp.databases.informix
Scott Burns schrieb:
> Hi,
> just wanted to confirm my impression that 4gl won't let you use
> logical ands in select on bit fields under SE.
>
> What we want to do is select ... where amendFlag & 0x6, that is, when
> the second and third bits of amendFlag are set.
>
> I suspect we are going to be reduced to selecting all then manually
> running through each to find the one we want.
>
> Are there easier/better ways?
>
Hi Scott,
search Google Newsgroups for my posting from around Feb. 2003, where I posted
some stored procedures which will do the job.
Regards
Roland
--
Roland Wintgen (Systemadministrator)
EVG Elektro-Vertriebs-Gesellschaft Martens GmbH & Co KG
Trompeterallee 244-246, D-41189 Moenchengladbach
Tel. +49 21 66 / 55 08 23, Fax 0 21 66 / 55 08 90
www.evg.de rw@evg.de
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.