hi,
i somehow think there must be a way to do the following, but can't remember / figure out how (feel pretty stupid):
assume i have an OPTIONS variable that can contain several TRUE/FALSE at once.
dcl options bin fixed(31);
dcl 1 options_c,
2 bold bin fixed(31) value(1),
2 italic bin fixed(31) value(2),
3 underscore bin fixed(31) value(4);
options = bold+underscore;
how do i - most smart - check for the single options?
something like
if options & options_c.bold then ...
thanks in advance,
br johann
On 23/05/2023 07:14, johann woeckinger wrote:
hi,
i somehow think there must be a way to do the following, but can't
remember / figure out how (feel pretty stupid):
assume i have an OPTIONS variable that can contain several TRUE/FALSE
at once.
dcl options bin fixed(31);
dcl 1 options_c,
2 bold bin fixed(31) value(1),
2 italic bin fixed(31) value(2),
3 underscore bin fixed(31) value(4);
options = bold+underscore;
how do i - most smart - check for the single options?
something like
if options & options_c.bold then ...
thanks in advance,
br johann
How about
TSTtest206: PROCEDURE options(main);
n1=15; n2=2;
put skip edit("n1=",n1,"(",unspec(n1),")")(a,f(5),a,b(8),a);
put skip edit("n2=",n2,"(",unspec(n2),")")(a,f(5),a,b(8),a);
result=(unspec(n1) & unspec(n2));
put skip edit(result,n3)(b(8),x(1),f(5));
n1=13; n2=2;
put skip edit("n1=",n1,"(",unspec(n1),")")(a,f(5),a,b(8),a);
put skip edit("n2=",n2,"(",unspec(n2),")")(a,f(5),a,b(8),a);
result=(unspec(n1) & unspec(n2));
put skip edit(result,n3)(b(8),x(1),f(5));
return;
Dcl(n1,n2,n3) fixed bin(31),
result bit(32) based(addr(n3));
end TSTtest206;
n1= 15(00001111) OPTIONS
n2= 2(00000010) ITALICS only
00000010 2 AND operation says ITALICS in effect
n1= 13(00001101) OPTIONS
n2= 2(00000010) ITALICS only
00000000 0 AND operation says ITALICS not in effect
Using n3 and result overlaid allows you to test ITALICS by the result
2(on) 0(off)
I could not see a builtin function the opposite of UNSPEC, hence my
overlay.
hi,
i somehow think there must be a way to do the following, but can't
remember / figure out how (feel pretty stupid):
assume i have an OPTIONS variable that can contain several TRUE/FALSE at once.
dcl options bin fixed(31);
dcl 1 options_c,
2 bold bin fixed(31) value(1),
2 italic bin fixed(31) value(2),
3 underscore bin fixed(31) value(4);
options = bold+underscore;
how do i - most smart - check for the single options?
something like
if options & options_c.bold then ...
thanks in advance,
br johann
hi,
i somehow think there must be a way to do the following, but can't remember / figure out how (feel pretty stupid):
assume i have an OPTIONS variable that can contain several TRUE/FALSE at once.
dcl options bin fixed(31);
dcl 1 options_c,
2 bold bin fixed(31) value(1),
2 italic bin fixed(31) value(2),
3 underscore bin fixed(31) value(4);
options = bold+underscore;
how do i - most smart - check for the single options?
something like
if options & options_c.bold then ...
thanks in advance,
br johann
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 379 |
Nodes: | 16 (2 / 14) |
Uptime: | 84:47:17 |
Calls: | 8,091 |
Files: | 13,069 |
Messages: | 5,851,128 |