The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find & Remove String From List
#1
Good morning QM Forum,

I've been trying to accomplish this task without asking, but I'm stuck at the last bit of information that I need. I'm working on a collaborative macro that displays online users in the main dialog box. It gets this information from a web page using InitGetFile. I've simulated that process with the accountList str. When a user signs out of the software I want to remove them from the list. If the account isn't the first in the list the example works perfectly, but if the account is the first item in the list it will leave the top spot empty instead of replacing it.

I know that I can find the line of the username with numlines and can check if line = 0, but I'm not sure how to remove the empty item at the top.

Macro Example String Replacement
Code:
Copy      Help
;; simulates the info received from webpage
str accountList = "account1[]account2[]account3[]account4[]account5"
str getAccount  = "account1"

accountList.replacerx(getAccount "")
accountList.findreplace("[][]" "[]" 8)
out accountList


Messages In This Thread
Find & Remove String From List - by BJ - 06-26-2018, 03:01 PM
RE: Find & Remove String From List - by BJ - 06-26-2018, 04:20 PM
RE: Find & Remove String From List - by Kevin - 06-26-2018, 04:21 PM
RE: Find & Remove String From List - by BJ - 06-26-2018, 04:22 PM
RE: Find & Remove String From List - by Kevin - 06-26-2018, 04:56 PM
RE: Find & Remove String From List - by BJ - 06-26-2018, 05:18 PM
RE: Find & Remove String From List - by Kevin - 06-26-2018, 06:10 PM
RE: Find & Remove String From List - by BJ - 06-26-2018, 06:58 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)