Solved

replace a var in an array

Posted on 2004-08-20
3
188 Views
Last Modified: 2010-05-02
im looking to replace a word in a array list of something like "#4,#hello,#yellow,#Den,#Charlie,#wow,#menu"

and replace #4 with #4:20

my array list is housed in arglist(1) allready

how do i do that please

thanks ever so much
0
Comment
Question by:Johnny
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
Colosseo earned 500 total points
ID: 11856456
Hi Pern

I hope this is what you are after

' value to find
str_Search = "#4"

' value to replace search string with
str_Replace = "#4:20"

' populate array
arglist = Array("#4", "#hello", "#yellow", "#Den", "#Charlie", "#wow", "#menu")

' for each item in the array
For i = LBound(arglist) To UBound(arglist)
  ' if the search string is found then replace it
  If arglist(i) = str_Search Then arglist(i) = str_Replace
Next

Regards

Scott
0
 

Author Comment

by:Johnny
ID: 11856543
one million percent perfect thx  Colosseo

heres your points
0
 
LVL 15

Expert Comment

by:Colosseo
ID: 11856557
Hi Pern

one million percent perfect sounds good too me :)

Glad your happy and thanks for the grade!

Scott
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question