10-20-2023, 01:01 PM
`WITH` in Freebasic was designed to save wear and tear for the programmer, having to type in the UDT variable's name.
Instead of:
could break it down in that other programming system as:
Some people would like to be able to exclude the period because it looks funny in front of an identifier like that. It's actually this way in Pascal but it could produce many long hours in debugging trying to find something.
I was being facetious in the example but when working with many UDT's, like must be done in Windows API programming, this `WITH` was helpful to a few programmers in the BASIC dialects that have it. If QB64 could feature macro substitution in its "preprocessor", however, I think `WITH` wouldn't really be necessary. In fact macro substitution could help make the code more readable.
Instead of:
Code: (Select All)
verylongvariablenamebutitsshorterjustforthisexample(j).x = i
verylongvariablenamebutitsshorterjustforthisexample(j).y = j
could break it down in that other programming system as:
Code: (Select All)
with verylongvariablenamebutitsshorterjustforthisexample(j)
.x = i
.y = j
end with
Some people would like to be able to exclude the period because it looks funny in front of an identifier like that. It's actually this way in Pascal but it could produce many long hours in debugging trying to find something.
I was being facetious in the example but when working with many UDT's, like must be done in Windows API programming, this `WITH` was helpful to a few programmers in the BASIC dialects that have it. If QB64 could feature macro substitution in its "preprocessor", however, I think `WITH` wouldn't really be necessary. In fact macro substitution could help make the code more readable.