Square brackets and curly brackets in expressions?
#9
(02-13-2023, 05:49 PM)CharlieJV Wrote: I'm thinking of adding the ability to use curly brackets and square brackets in expressions, along with parentheses, to make complex expressions easier to read.

But not if square brackets (i.e. [ and ] ) and curly brackets (i.e. { and } ) are used in any way as special characters in QB64pe.

Are square brackets and/or curly brackets used for any purpose in QB64pe?  (I haven't noticed any.)

Just some samples I'm using to evaluate.

Just enough of a subtle visual cue to see what goes with what.

I think.


Code: (Select All)
PRINT ( [ 1 + 2 ] / [ 3 + 4 ] ) + 5
' vs
PRINT ( ( 1 + 2 ) / ( 3 + 4 ) ) + 5

8 PSET (ix, iy), ( [ix - L] XOR [iy + L] ) XOR ( [ix + L] XOR [iy - L] )
'vs
8 PSET (ix, iy), ( (ix - L) XOR (iy + L) ) XOR ( (ix + L) XOR (iy - L) )

VAL(MID$(M$, [{Y% * 2} * 16] + [X% * 2] + 1, 2))
'vs
VAL(MID$(M$, ((Y% * 2) * 16) + (X% * 2) + 1, 2))

PSET ( [ 160 + COS(A!) * 50 + X% ], [ 100 + SIN(A!) * 50 + Y%] ), this_c
'vs
PSET (160 + COS(A!) * 50 + X%, 100 + SIN(A!) * 50 + Y%), this_c
Reply


Messages In This Thread
RE: Square brackets and curly brackets in expressions? - by CharlieJV - 02-14-2023, 03:19 AM



Users browsing this thread: 4 Guest(s)