473,425 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,425 software developers and data experts.

String Munging

Hi All

Need another favour.

I have an Access memo field that contains a list of single random words that
are separated by a single space. What I need to do is extract a random word
from this list 8 times so that I can have the following to play with:

1stRandomWord.2ndRandomWord

3rdRandomWord.4thRandomWord

5thRandomWord.6thRandomWord

7thRandomWord.8thRandomWord

I doing a Access DB to ASP page, so any ASP-compliant VB example code would
be really appreciated.

Rgds

Laphan
Jul 17 '05 #1
1 2859
Many thanks MN

Much appreciated.

Rgds Laphan

MN <im***********@hotmail.com> wrote in message
news:ad**************************@posting.google.c om...
"Laphan" <ne**@FrozenMoles.co.uk> wrote in message
news:<be**********@sparta.btinternet.com>...
Hi All

Need another favour.

I have an Access memo field that contains a list of single random words that are separated by a single space. What I need to do is extract a random word from this list 8 times so that I can have the following to play with:

1stRandomWord.2ndRandomWord

3rdRandomWord.4thRandomWord

5thRandomWord.6thRandomWord

7thRandomWord.8thRandomWord

I doing a Access DB to ASP page, so any ASP-compliant VB example code would be really appreciated.

Rgds

Laphan

Read you word list into a string variable and use the VB split
function to break the words apart at the " " character.

lstrWordList = lobjRst("<name of memo field>")
lstrWordArr = split(lstrWordList," ")

response.write(lstrWordArr(0) & "." & lstrWordArr(1) & "<br>")

Remembering that in VB(Script) array indexes start at 0.

If you want to make it more generic then ubound(<array variable name>)
can be used to get the upper bound of the array so you can do your
processing in a loop.

If the delimeter specified as argument 2 of the split function is not
found in the string the whole string will be in element 0 of the
array.

Enjoy.
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Krakatioison | last post by:
My sites navigation is like this: http://www.newsbackup.com/index.php?n=000000000040900000 , depending on the variable "n" (which is always a number), it will take me anywhere on the site......
5
by: Stu Cazzo | last post by:
I have the following: String myStringArray; String myString = "98 99 100"; I want to split up myString and put it into myStringArray. If I use this: myStringArray = myString.split(" "); it...
9
by: John F Dutcher | last post by:
I use code like the following to retrieve fields from a form: recd = recd.append(string.ljust(form.getfirst("lname",' '),15)) recd.append(string.ljust(form.getfirst("fname",' '),15)) etc.,...
9
by: Derek Hart | last post by:
I wish to execute code from a string. The string will have a function name, which will return a string: Dim a as string a = "MyFunctionName(param1, param2)" I have seen a ton of people...
6
by: Jerry Werner | last post by:
I need to replace my email address on hundreds of web pages with a new address (in a graphic, not a mailto) in order to thwart the email harvesters that spammers are using. Ideally, I'd like to do...
18
by: Ralf W. Grosse-Kunstleve | last post by:
My initial proposal (http://cci.lbl.gov/~rwgk/python/adopt_init_args_2005_07_02.html) didn't exactly get a warm welcome... And Now for Something Completely Different: class autoinit(object):...
24
by: Wim Roffal | last post by:
Is there a possibility to do a string replace in javascript without regular experessions. It feels like using a hammer to crash an egg. Wim
5
by: | last post by:
Hi, I'm trying to use the cookie munging session handling behaviour of asp.net instead of cookies themselves as I'm finding quite a few people are barring cookies (especially AOL users). If I...
66
by: dattts | last post by:
what is the difference between a single character and a string consisting only one character
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.