Powerbasic Museum 2020-B

IT-Consultant: Charles Pegge => OxygenBasic => Topic started by: Chris Chancellor on January 14, 2019, 04:37:09 PM

Title: what is this notation qs*=
Post by: Chris Chancellor on January 14, 2019, 04:37:09 PM
Hello Charles

i saw the below codes in the O2 forum  at  reply#6
https://www.oxygenbasic.org/forum/index.php?topic=1847.msg20013;topicseen#msg20013 (https://www.oxygenbasic.org/forum/index.php?topic=1847.msg20013;topicseen#msg20013)


quad qs=0x10000 : qs*=0x10000
quad a= qs*0x12345678+0x9abcdef0


i don't understand the notation qs*=0x10000

i knew 0x10000  is a hex number  but not  qs*

because *  means multiplication for normal operators

what does  qs*   or  qs*=    do ?

are these notations derived from C ?

sorry that i asked these simple questions

Title: Re: what is this notation qs*=
Post by: Mike Lobanovsky on January 14, 2019, 05:21:31 PM
qs *= 0x10000 is a shorthand for qs = qs * 0x10000 pretty much like qs += 1 is a shorthand for qs = qs + 1.

The math operator preceding assignment can be any arith or logical operator like *=, /=, AND= etc., in which case the expression unrolls as shown above.

Note there should be no space between the operator and assignment for the O2 parser to understand the expression.
Title: Re: what is this notation qs*=
Post by: Chris Chancellor on January 14, 2019, 06:00:28 PM
Thanxx a lot, Mike