Re: Bitwise operators in SQLs/4GLs
Posted in 2004
Doug Lawry said: > You could compile in a C function: Or you could extend IDS 9 with equivalent functions...? > 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 > > -- Bye now, Obnoxio "C'est pas parce qu'on n'a rien ' dire qu'il faut fermer sa gueule" - Coluche "I'm trying to see things your way, but I can't get my head up my ass" - JCH "Ogni uomo mi guarda come se fossi una testa di cazzo" - Marco http://www.catb.org/~esr/faqs/smart-questions.html sending to informix-list