Centering text inside char bax
#11
(04-10-2023, 01:06 PM)PhilOfPerth Wrote: @mnrvovrc:  I'm not into fancy dialogs, but now I have a new word to "investulate": $noprefix. Thanks for your input.

If you want my honest opinion, just forget that NoPrefix even exists.  When one command alters or invalidates other commands for you, it's one that should often just be ignored.  Is it really that much extra work to type an underscore for the QB64 specific keywords?

Two things to watch for with NOPrefix:

1) Various commands and such fall into conflict and require code changes just by popping it into your code.

$COLOR:32
CLS Red
PRINT _Red(4)

Take the above into consideration.  As is, it works just peachy fine.  You can use the color CONST Red with your program, as well as the command _Red to get back red levels from a color on the screen.

Add a $NoPrefix to that, however, and you now have Red being a command (where it was _Red before), and that conflicts with Red as the color.  Your code is now going to glitch out until you go in and alter all references to Red (the color) so they no longer conflict with Red (the command).   This also applies to Green and Blue as well...

2) Code you write with NoPrefix today may not compile without changes tomorrow.

Let's say you write a program and use a variable called Foo.  DIM Foo AS LONG...

Now, 2 years from now, we add a new command into the language:  _FOO.   

What happens to your old code??  It's now got to be changed to compile with new versions of QB64 with $NoPrefix because Foo (would be the unprefixed version of _Foo), and you can't make your variable the same as a reserved function.



There was a reason why Galleon reserved that underscore for use with QB64-specific keywords, and why user's can't create any variables or CONST with just a single leading underscore to them.  Honestly, why the old team decided to even add $NoPrefix to the language is beyond me.  It breaks existing commands with Red, Green, Blue and $Color, and it has the potential to break future compatibility with anything an user writes.  And for what??  Just to save typing a leading underscore for the QB64 specific keywords??

It's not worth the drawbacks in using it, in my opinion.
Reply


Messages In This Thread
Centering text inside char bax - by bplus - 04-08-2023, 05:05 PM
RE: Centering text inside char bax - by mnrvovrfc - 04-08-2023, 06:05 PM
RE: Centering text inside char bax - by bplus - 04-08-2023, 11:44 PM
RE: Centering text inside char bax - by bplus - 04-09-2023, 12:25 AM
RE: Centering text inside char bax - by mnrvovrfc - 04-10-2023, 12:27 PM
RE: Centering text inside char bax - by bplus - 04-10-2023, 03:01 PM
RE: Centering text inside char bax - by bplus - 04-10-2023, 03:10 PM
RE: Centering text inside char bax - by SMcNeill - 04-11-2023, 05:38 PM
RE: Centering text inside char bax - by OldMoses - 04-11-2023, 05:22 PM
RE: Centering text inside char bax - by mnrvovrfc - 04-11-2023, 07:10 PM
RE: Centering text inside char bax - by SMcNeill - 04-11-2023, 11:31 PM
RE: Centering text inside char bax - by OldMoses - 04-12-2023, 12:44 AM



Users browsing this thread: 3 Guest(s)