10-19-2023, 07:17 PM
Have there been any thoughts on making a "WITH" keyword for QB64 for assigning values to UDT members?
Tread on those who tread on you
"WITH" keyword
|
10-19-2023, 07:17 PM
Have there been any thoughts on making a "WITH" keyword for QB64 for assigning values to UDT members?
Tread on those who tread on you
10-20-2023, 12:48 PM
Hi Spriggsy - would that create the Type and dimension the variables or how do you see that working with UDT?
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: Code: (Select All) verylongvariablenamebutitsshorterjustforthisexample(j).x = i could break it down in that other programming system as: Code: (Select All) with verylongvariablenamebutitsshorterjustforthisexample(j) 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.
10-20-2023, 01:47 PM
Personally, I'd rather see Alias expanded.
Alias verylongvariablenamebutitsshorterjustforthisexample AS foo foo.x = foo.y =
10-20-2023, 02:32 PM
If we do aliases, then the next logical step would be aliasing variable types as well.
Alias UNSIGNED LONG AS DWORD
Tread on those who tread on you
10-20-2023, 04:18 PM
(10-20-2023, 02:32 PM)SpriggsySpriggs Wrote: If we do aliases, then the next logical step would be aliasing variable types as well. The only thing I've to say about: STOP TRYING TO FAKE OTHER LANGUAGES !!
GuiTools, Blankers & other Projects:
https://qb64phoenix.com/forum/forumdisplay.php?fid=32 Libraries & useful Functions: https://qb64phoenix.com/forum/forumdisplay.php?fid=23
10-20-2023, 04:55 PM
Tread on those who tread on you
10-20-2023, 05:25 PM
I don't care about faking other languages; all I want is a shorthand for typing junk.
ALIAS "_PRINTSTRING(" AS "??" ?? x, y), "Hello World" Just as CONST does basic substitution, so does Alias, so that's just shorthand for: _PRINTSTRING(x, y), "Hello World" (10-20-2023, 05:25 PM)SMcNeill Wrote: I don't care about faking other languages; all I want is a shorthand for typing junk. I was doing that with editor I was building with old VB for DOS (very easy to build editors there BTW!) All the long paragraphs in a variable name put on a list you could click to paste in. (10-20-2023, 04:55 PM)SpriggsySpriggs Wrote:(10-20-2023, 04:18 PM)RhoSigma Wrote: STOP TRYING TO FAKE OTHER LANGUAGES !! +1 Who can happily pass up a great idea?
b = b + ...
|
« Next Oldest | Next Newest »
|