Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching memo fields 1

Status
Not open for further replies.

JCoates

IS-IT--Management
Dec 13, 2001
19
US
Hello,

I've written some routines that place a series of pieces of information into a memo field. However, I would like to be able to pull individual chunks back out.

Let me explain better... the user may select "silver" for the option from "choose metal type" on a form. When they submit the form, the following is placed into a memo field:

metal - silver

The can do this for several items and it places the results all in the same memo field (I had to do it this way, because the number of items can vary and the headers for each can change. In the end, the memo field might look like this:

metal - silver
weld - seemless
finish - polished

What I want to be able to do, is search the memo field for "metal" and have it return "silver" to a variable etc.

Is there a way for me to do this?

Thanks,
Jim Coates
jcoates@westmusic.com
Director of IT
West Music
 
There are some Memo-field processing commands you can use as long as the memo field doesn't get too big. (If it gets too big, the commands become VERY slow...)

Try these commands:

ATLINE("metal","myMemo")
returns the line number that "metal" appears in (in this case, line 1)

MLINE(1)
returns line 1 of the memo field

Using these two commands together should accomplish what you're looking for.

Ian
 
Ian,

That worked... thanks...

Let me ask you one more thing. One my form, I'm replacing the caption value of 20 some drop downs...

Is there a way to do this in a loop?

Right now I'm doing:

thisform.label1.caption = blah
thisform.label2.caption = blah
etc.

I'd like to do:

for i = 1 to 20
thisform.labeli.caption = blah
endfor

Can that be done?

Thanks.. you've been MOST helpful
Jim
 
Yep...just use macro substitution:
[tt]
for i = 1 to 20
cLabel="thisform.label"+alltrim(str(i))
&cLabel..caption = blah
endfor
[/tt]
Yes, there are two dots before "caption". :eek:)

Ian
 
Ian,

Thanks a bunch... that worked beautifully.

Saved me TONS of time reproducing code over and over again.

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top