Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"WITH" keyword
#11
Posts merge if you double post within just a minute or two, as long as no one else has posted after you.  It basically treats a double post as an edit to the first post.
Reply
#12
(10-20-2023, 05:41 PM)SMcNeill Wrote: Posts merge if you double post within just a minute or two, as long as no one else has posted after you.  It basically treats a double post as an edit to the first post.

I was going for a triple maybe later ;-))

Maybe now!

With this!!!
b = b + ...
Reply
#13
Hehe!
b = b + ...
Reply
#14
(10-20-2023, 04:18 PM)RhoSigma Wrote: The only thing I've to say about:

STOP TRYING TO FAKE OTHER LANGUAGES !!

QB64 is already well on its way of faking other languages. With the sort-of preprocessor it has. That was my proposal. Then it would be the programmer's choice if he/she wants to dress up BASIC like Python or something else.

`ALIAS` might have to become `$ALIAS` instead. Otherwise the name is confusing. Another BASIC straight out uses `TYPE` but it's not reasoned as part of preprocessing, which is interesting.
Reply
#15
(10-19-2023, 07:17 PM)SpriggsySpriggs Wrote: Have there been any thoughts on making a "WITH" keyword for QB64 for assigning values to UDT members?

I would not be opposed to WITH, if and only if, the QB64PE IDE included a command to auto-fill in the explicit variable name in a selected code block. Because I personally don't like reading through code inside a WITH - it's easier for my brain to visualize what's happening by seeing the actual variable name. 

I like Steve's alias suggestion, as long as we don't go crazy with it, and start adding all kinds of complicated things (aliased types, etc.)

Just my own personal preference!
Reply
#16
Just don't make it so long or shorten it when you are working in a sub or function where the work gets done.


Type areallyridiculosulylongUDTthathasaridiculouslynamedtype_type
x as long
y as long
end type
dim thevariabelewithareallyridiculosulylongUDTthathasaridiculouslynamedtype(100) as  areallyridiculosulylongUDTthathasaridiculouslynamedtype_type

....
addtoX 12, thevariabelewithareallyridiculosulylongUDTthathasaridiculouslynamedtype(i)
...

sub addtoX(N as long,v as  areallyridiculosulylongUDTthathasaridiculouslynamedtype_type)
v.x=v.x+N
end sub
Reply
#17
(10-27-2023, 04:01 PM)James D Jarvis Wrote: Just don't make it so long or shorten it when you are working in a sub or function where the work gets done.


Type areallyridiculosulylongUDTthathasaridiculouslynamedtype_type
x as long
y as long
end type
dim thevariabelewithareallyridiculosulylongUDTthathasaridiculouslynamedtype(100) as  areallyridiculosulylongUDTthathasaridiculouslynamedtype_type

....
addtoX 12, thevariabelewithareallyridiculosulylongUDTthathasaridiculouslynamedtype(i)
...

sub addtoX(N as long,v as  areallyridiculosulylongUDTthathasaridiculouslynamedtype_type)
v.x=v.x+N
end sub
That'll work too!
:-D
Reply




Users browsing this thread: 7 Guest(s)