If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Corel Paradox > Array elements

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-16-05, 14:20
Rick Schreiber Rick Schreiber is offline
Registered User
 
Join Date: Mar 2004
Location: California
Posts: 400
Array elements

StNo Street Name
18880 Nordhoff Street #6

Desired result should be

StNo Street Name
18800 Nordhoff Street #6

The code below successfully copies just the street number away from the street address field and places it in the StNo field.

But it does not delete the street number from the original street address filed
leaving just the street name and all elements to the right of street name.

ANY IDEAS ON HOW TO DO THAT?
Thanks . . . Rick

method run(var eventInfo Event)
{breakApart method. This syntax is used to separate
the street number from the street name}
Var
ImpMoore1 table
ar Array[] String
tc tCursor
s,str String
si SmallInt
endVar
{-----------------------------------------------------------------}
addAlias("MYDIR","Standard","D:\\Pdoxwin7\\Moore")
{-----------------------------------------------------------------}
if Not tc.open("D:\\Pdoxwin7\\Moore\\ImpMoore1.db") then
errorShow()
return
endif
tc.edit()
scan tc:
str=tc."AddressDisplay".value ;field name in table
str.breakApart(ar, " ") ;use space as delimiter
for i from 1 to 1 ;limites data to the left of the first space in the field
str=ar[i] ;assigns data to str from left of first space in field
endfor

tc."StNo".value=str ;places str value in StNo field
endscan
tc.close()
endMethod
Reply With Quote
  #2 (permalink)  
Old 01-18-05, 12:33
Maroonotmoron Maroonotmoron is offline
Registered User
 
Join Date: Sep 2003
Location: Dallas
Posts: 182
Add the following

after : tc."StNo".value=str ;places str value in StNo field

tc."Address" = substr(tc.addressdisplay.value,length(str)+2, 40)

That will pull out the address beginning with the value after the space and including up to 40 characters thereafter. You can adjust it if the actuall addressplay field can be longer.

Lonnie
Reply With Quote
  #3 (permalink)  
Old 01-18-05, 13:26
Rick Schreiber Rick Schreiber is offline
Registered User
 
Join Date: Mar 2004
Location: California
Posts: 400
Array Assignments

Hey Lonnie . . . that looks great. I'll try it as soon as I can and let you know how it works.

Thanks much!

Rick
Reply With Quote
  #4 (permalink)  
Old 01-19-05, 09:28
Rick Schreiber Rick Schreiber is offline
Registered User
 
Join Date: Mar 2004
Location: California
Posts: 400
Unknown Method Name

Hi Lonnie . . .

tc."Address" = substr(tc.addressdisplay.value,length(str)+2, 40)

When I added this to my code as you suggested, I get the following error with the word "length" highlighted . . . Unknown Method Name

Any ideas . . ?

Thanks . Rick
Reply With Quote
  #5 (permalink)  
Old 01-19-05, 14:01
Maroonotmoron Maroonotmoron is offline
Registered User
 
Join Date: Sep 2003
Location: Dallas
Posts: 182
Red face Oops wrong language

tc."Address" = substr(tc.addressdisplay.value,str.size()+2, 40)

If you substitute this line (str.size() replacing length(str) it should work.

Of course that assumes that you have a field called address. If not you need to replace the tc."address" object with your field name.

Lonnie
Reply With Quote
  #6 (permalink)  
Old 01-19-05, 17:22
Rick Schreiber Rick Schreiber is offline
Registered User
 
Join Date: Mar 2004
Location: California
Posts: 400
Opps . . . wrong language!

Sheesh, I sure wish I had the intellegence you have Lonnie.

I have to fight just to get Paradox into edit mode. Ha!

I'll get back to you.

Thanks again . . . Rick
Reply With Quote
  #7 (permalink)  
Old 01-19-05, 20:35
Rick Schreiber Rick Schreiber is offline
Registered User
 
Join Date: Mar 2004
Location: California
Posts: 400
Got It Lonnie . . .

That fix did the trick.

Thanks . . . I mean THANKS MUCH for your help Lonnie.

Rick
Reply With Quote
  #8 (permalink)  
Old 01-20-05, 16:34
Maroonotmoron Maroonotmoron is offline
Registered User
 
Join Date: Sep 2003
Location: Dallas
Posts: 182
Glad it worked!

Glad to do it!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On