News:

  • October 02, 2026, 05:25:59 AM

Login with username, password and session length

Author Topic: Initialization of Strings  (Read 15971 times)

RBPLC

  • Hero Member
  • *****
  • Posts: 586
Initialization of Strings
« on: August 31, 2019, 09:43:58 AM »
In the first scan I'm trying to define string variables. I tried this with the COPY command but get errors when trying to enter my strings as text into the source field. What is the proper way to write a string to a variable to define it?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Initialization of Strings
« Reply #1 on: August 31, 2019, 09:52:58 AM »
We probably should look at adding a string option to INIT, but I guess the best way is STRPRINT.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

RBPLC

  • Hero Member
  • *****
  • Posts: 586
Re: Initialization of Strings
« Reply #2 on: August 31, 2019, 10:18:59 AM »
Thanks Bob. I would recommend something like INIT or COPY so that many of these can be defined in one instruction.

Bolt

  • Hero Member
  • *****
  • Posts: 598
Re: Initialization of Strings
« Reply #3 on: August 31, 2019, 02:49:35 PM »
I've often wondered just what the difference is between INIT and COPY.  And MAPIO and COPY.  Why would one use MAPIO when COPY lets you do ranges of elements?

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Initialization of Strings
« Reply #4 on: August 31, 2019, 07:33:13 PM »
I've often wondered just what the difference is between INIT and COPY.  And MAPIO and COPY.  Why would one use MAPIO when COPY lets you do ranges of elements?
COPY and INIT are both "macros" (along with CALL).  COPY was developed later once we had a better set of "data assignment" instructions.  COPY really should be the one stop shop for 90% of your data assignments.  One of its limitations is string literals - you still have to use STRPRINT for that.  We can definitely look at addressing that in the future.

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Initialization of Strings
« Reply #5 on: September 01, 2019, 09:06:25 AM »
You have my vote for adding string initializations to Init
« Last Edit: September 02, 2019, 09:32:03 AM by ATU »

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Initialization of Strings
« Reply #6 on: September 01, 2019, 12:17:17 PM »
You have my vote for adding string nationalizations to Init

I was planning on doing it for COPY, but if we do what I want to do, I should also be able to add it to INIT also.  TomAYto TomAHto.  One person's INIT instruction is another person's COPY instruction.

Andrew S

  • Hero Member
  • *****
  • Posts: 144
Re: Initialization of Strings
« Reply #7 on: September 01, 2019, 12:33:54 PM »
Thanks. I use INIT much more often that COPY so I'd find that very useful.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Initialization of Strings
« Reply #8 on: September 01, 2019, 01:47:55 PM »
COPY is a superset of INIT.  It can do everything INIT does, plus what MOVER and MEMCOPY can do.

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Initialization of Strings
« Reply #9 on: September 01, 2019, 04:24:16 PM »
I have pretty much standardized on using INIT in my initialization stages.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Initialization of Strings
« Reply #10 on: September 01, 2019, 05:40:08 PM »
I like the idea of adding literals to INIT, we'll just need to see how much it takes.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO