Author Topic: Combining 2 AppVars into 1  (Read 2609 times)

0 Members and 1 Guest are viewing this topic.

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Combining 2 AppVars into 1
« on: September 07, 2010, 12:36:26 pm »
I have two appvar, each containing a string of different (or possibly equal) length. Each string contains the names of programs to be searched for, separated by commas.

"appvA"->Str2A
"appvB"->Str2B

I want to combine the two into one, and check for any program names in common between the two, and if so, store it to the combined appvar only once. Any ideas?
« Last Edit: September 07, 2010, 04:00:33 pm by ACagliano »

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Combining 2 AppVars into 1
« Reply #1 on: September 07, 2010, 08:13:33 pm »
Well, I'm not sure about the name checking, but to combine 2 ram appvars A and B into C, you can do this:

Code: [Select]
Return!If GetCalc("appvA")->A
Return!If GetCalc("appvB")->B
{A-2}r->X   .Size of A
{B-2}r->Y   .Size of B
Return!If GetCalc("appvC",X+Y)->C
Copy(A,C,X)
Copy(B,C+X,Y)
Delvar "appvA"
Delvar "appvB"
___Axe_Parser___
Today the calculator, tomorrow the world!