Author Topic: $REPLACE  (Read 11603 times)

0 Members and 1 Guest are viewing this topic.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: $REPLACE
« Reply #15 on: September 16, 2018, 03:00:37 pm »
Quote
I used to just do things like a1$ and do a universal word change in notepad or the IDE when the program was finished. I kept an index legend of the variable names like a1$ = helloworldvariabletoprinthelloworldtothescreenforthisexcitingprogramexampleiputtogetherinseverallongpainstakingweeksofwork$

So this effect is pretty cool, as it do that on the fly... well, unless yo code in Notepad, like I often do. That's where the metacommand confusion could be a problem.

That's why I, personally, like this approach -- the on-the-fly substitution.  Just typing a1$ and a2$, then changing them after, makes it quite possible to mislabel your code, without ever noticing it, and then correcting the issue is a total PITA.  Change as you go, and you'll see the glitch as soon as it occurs, and not after some mass change obfuscates it almost beyond repair.

As for coding outside the IDE, simply *don't* use it, unless you can write a script to use $REPLACE to update the AutoText lookup table.  (I'm thinking it'd be possible with some work for notepad++, at least.)
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

FellippeHeitor

  • Guest
Re: $REPLACE
« Reply #16 on: September 16, 2018, 03:26:35 pm »
It doesn't seem like you're working on top of the latest dev build, Steve. Please make sure you are before pushing changes (and also that you push the changes into development as well).
« Last Edit: September 16, 2018, 03:28:08 pm by FellippeHeitor »

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: $REPLACE
« Reply #17 on: September 16, 2018, 03:45:45 pm »
It doesn't seem like you're working on top of the latest dev build, Steve. Please make sure you are before pushing changes (and also that you push the changes into development as well).

I haven't been.  I've been working with the 64-bit version, which hasn't been updated for a few months now.  To be honest, I'm not certain if I'd prefer to update QB64 to add $REPLACE as a standard command for everyone, or else make it a script which someone can use to add the capability to their version if they desire.  (Much like my AutoSave script does which alters QB64 to save the current IDE program to a time stamped BAS file every XX number of minutes.)

If an user has to install it, they're a lot less likely to misunderstand what it does and how to use it.

I'm thinking easiest solution is to change it to be called '$REPLACE, so users without the mod *CAN'T* be affected by it, and then have a small BAS file/EXE where somebody could use to update the ability into their personal version, if they choose.  I'm thinking that'd probably be the easiest way to add functionality, while minimizing misuse/misfunctionality, as much as possible.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

FellippeHeitor

  • Guest
Re: $REPLACE
« Reply #18 on: September 16, 2018, 03:56:39 pm »
It's one of those scenarios that have been argued over the years: one wants a new functionality which may be misused. Clippy would have already thrown a fit just for you considering it.

Every new command in the language was fought against until it eventually made it to the final mix. I for one can say everything I wanted added was fought against at the time of discussing it.

Turns out that one won't have issues with it if it's not used.

All that said, though, it's ultimately your call.