Home > Archive > Getting Started with dBASE > October 2006 > Newbie dbase3+ add text to field (in addition to exisiting text)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Newbie dbase3+ add text to field (in addition to exisiting text)
SleekJag

2006-10-25, 7:23 am

Can anyone assist me with the dbase 3+ entry I need to enter text (which includes characters e.g. ">" or "/" but should only be recognized as text) to modify a field in a dbf file that has text in it already. What I am trying to acheive is to add the same
text entry to all cells (regardless of whether they have a current text entry) either before the current text or after e.g. before: ABC after: 123(Space)ABC OR e.g. before: ABC after: ABC(SPACE)123

Thank you in advance
john marshall

2006-10-25, 7:23 am



I'm not sure I completely understand the question, but assuming the field is text, it appears that

replace all entryfield1 with '123 ' + entryfield1, or
replace all entryfield1 with entryfield1 + ' 123'

should do the trick. (123 could be replaced with a variable or macro as well) Give it a try on a test DB first however!

JM


SleekJag Wrote:

> Can anyone assist me with the dbase 3+ entry I need to enter text (which includes characters e.g. ">" or "/" but should only be recognized as text) to modify a field in a dbf file that has text in it already. What I am trying to acheive is to add the sa

me text entry to all cells (regardless of whether they have a current text entry) either before the current text or after e.g. before: ABC after: 123(Space)ABC OR e.g. before: ABC after: ABC(SPACE)123
>
> Thank you in advance


Sleekjag

2006-10-25, 7:23 am

John,

THANK YOU! I attempted to respond yesterday but seemed the server was locked to access.

I was hesitant to use "replace all" as I thought I would lose current entries but I see the + portion you added.

Long and short - it worked and you saved me HOURS of manual entry

Thank you once again!


john marshall Wrote:

>
>
> I'm not sure I completely understand the question, but assuming the field is text, it appears that
>
> replace all entryfield1 with '123 ' + entryfield1, or
> replace all entryfield1 with entryfield1 + ' 123'
>
> should do the trick. (123 could be replaced with a variable or macro as well) Give it a try on a test DB first however!
>
> JM
>
>
> SleekJag Wrote:
>
same text entry to all cells (regardless of whether they have a current text entry) either before the current text or after e.g. before: ABC after: 123(Space)ABC OR e.g. before: ABC after: ABC(SPACE)123[color=
darkred]
>


John Marshall

2006-10-25, 7:23 am


You are welcome. I myself converted from dBase III to dBase Plus early last year. If you find that dBase is for your, I'd highly recommend taking a look at the latest version. dBase III code is mostly compatable, but there are tons of windows-like user
interface controls as well as other features that do make it a very contemporary product, but with historic familiarity.

JM


Sleekjag Wrote:

> John,
>
> THANK YOU! I attempted to respond yesterday but seemed the server was locked to access.
>
> I was hesitant to use "replace all" as I thought I would lose current entries but I see the + portion you added.
>
> Long and short - it worked and you saved me HOURS of manual entry
>
> Thank you once again!
>
>
> john marshall Wrote:
>
e same text entry to all cells (regardless of whether they have a current text entry) either before the current text or after e.g. before: ABC after: 123(Space)ABC OR e.g. before: ABC after: ABC(SPACE)123[color=
darkred]
>


Marilyn Price

2006-10-25, 7:23 am

In article <dRcNZ097GHA.1744@news-server>,
john. marshall@mainstreetp
rinceton.com says...
>
>
> I'm not sure I completely understand the question, but assuming
> the field is text, it appears that
>
> replace all entryfield1 with '123 ' + entryfield1, or
> replace all entryfield1 with entryfield1 + ' 123'
>


The second example won't change anything. Instead, try:

replace all entryfield1 with trim(entryfield1) + ' 123'

to get rid of any trailing blanks stored in the field.

--
Marilyn Price
M. P. Data
John Marshall

2006-10-25, 7:23 am


Thanks Marilyn, I spaced on that detail!

JM

Marilyn Price Wrote:

> In article <dRcNZ097GHA.1744@news-server>,
> john. marshall@mainstreetp
rinceton.com says...
>
> The second example won't change anything. Instead, try:
>
> replace all entryfield1 with trim(entryfield1) + ' 123'
>
> to get rid of any trailing blanks stored in the field.
>
> --
> Marilyn Price
> M. P. Data


SleekJag

2006-10-25, 7:23 am

John,

Thanks for your tip! In actuality, I am only using the program and needed to tweak data. I have no formal experience and I don't really know how proficient I would be - but it is an active interest. Guess won't know until I try. Thanks again for the tips.



John Marshall Wrote:

>
> You are welcome. I myself converted from dBase III to dBase Plus early last year. If you find that dBase is for your, I'd highly recommend taking a look at the latest version. dBase III code is mostly compatable, but there are tons of windows-like us

er interface controls as well as other features that do make it a very contemporary product, but with historic familiarity.
>
> JM
>
>
> Sleekjag Wrote:
>
the same text entry to all cells (regardless of whether they have a current text entry) either before the current text or after e.g. before: ABC after: 123(Space)ABC OR e.g. before: ABC after: ABC(SPACE)123[color=
darkred]
>


SleekJag

2006-10-25, 7:23 am

Marilyn,

I only tried the first example but did not use it actively on my system yet. Does it matter where the brackets go? i.e. should close bracket go after ' 123')?

John Marshall Wrote:

>
> Thanks Marilyn, I spaced on that detail!
>
> JM
>
> Marilyn Price Wrote:
>
>


Marilyn Price

2006-10-25, 7:23 am

In article <YubHlPU9GHA.1136@news-server>, xeronone2000@yahoo.com
says...
> Marilyn,
>
> I only tried the first example but did not use it actively on
> my system yet. Does it matter where the brackets go? i.e. should
> close bracket go after ' 123')?
>


Brackets??? If you are referring to this:
[color=darkred]

Those are the function's parentheses. You want to trim the entryfield
(only!!) before adding the new information.

If entryfield1 contains "XYZbbbbb" (where b = blank or space) and the
field is eight characters long, then entryfield1 + ' 123' would give you
a twelve character result. Stuffing that back into the eight character
field would only give you the eight leftmost characters.

However, trim(entryfield1) + ' 123' will give you "XYZ 123", which is a
seven character result. Stuffing this back into the eight character
field will actually result in "XYZ 123 " (note the two extra spaces).
dBase will _always_ blank fill a character field to completely fill the
space.

I hope this helps.

--
Marilyn Price
M. P. Data
sleekJag

2006-10-31, 12:18 am

Yes, Thank you!

Marilyn Price Wrote:

> In article <YubHlPU9GHA.1136@news-server>, xeronone2000@yahoo.com
> says...
>
> Brackets??? If you are referring to this:
>
>
> Those are the function's parentheses. You want to trim the entryfield
> (only!!) before adding the new information.
>
> If entryfield1 contains "XYZbbbbb" (where b = blank or space) and the
> field is eight characters long, then entryfield1 + ' 123' would give you
> a twelve character result. Stuffing that back into the eight character
> field would only give you the eight leftmost characters.
>
> However, trim(entryfield1) + ' 123' will give you "XYZ 123", which is a
> seven character result. Stuffing this back into the eight character
> field will actually result in "XYZ 123 " (note the two extra spaces).
> dBase will _always_ blank fill a character field to completely fill the
> space.
>
> I hope this helps.
>
> --
> Marilyn Price
> M. P. Data


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com