![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
How do I identify the last element of the array? |
#3
| |||
| |||
|
#4
| |||
| |||
|
#5
| |||
| |||
|
|
That looks like it should work to me, except that you need to include the "s" and "s1" strings in the argument for advMatch(): tc."Address".advMatch("^(..) (Blvd)$",s,s1). I alway put any spaces before "Blvd" between the first ")" and the following "(" of the halves of the whole string OUTSIDE the parentheses so they won't be picked up as part of the strings ... advMatch() seems to work better if there is SOMETHING definite that seperates the two halves you want to split up ... are you sure the table is open like you think? You haven't tested it, but if your logic is correct, you should be getting either the view()'s or the msgInfo() for EVERY record of the table the way this is written. What about writing a bit of test code that let's you enter an address and test your match arg in advMatch() ... you could even make it so that you can enter the match arg string interactively too ... get it working right for a string you KNOW what you put in and then use that arg for your table. I attached a sample script to show you what I mean ... works on my Windows 98 machine running Paradox 10, but there's nothing I know of to stop it from running in almost any version of Paradox since version 5! Oh, I just noticed .... on your code, you have a return inside the else of your if statement ... that means, if advMatch() fails on the FIRST record of your table, the code stops! Bet that's the trouble ... also explains why you don't see msgInfo() for EACH record in your table (assuming you don't). |
#6
| |||
| |||
|
|
Thanks David! You are right about the "Return". That is stopping it from running the rest of the table. I do get the msgInfo once. I have not written the for each loop into my scripts or code because I am just not 100% comfortable with my understanding of it. I'll look at your code and see if I can learn more. Thanks again. Jeff "David Farmer" <dafarmer (AT) hotmail (DOT) com> wrote in message news:43f88d86 (AT) pnews (DOT) thedbcommunity.com... That looks like it should work to me, except that you need to include the "s" and "s1" strings in the argument for advMatch(): tc."Address".advMatch("^(..) (Blvd)$",s,s1). I alway put any spaces before "Blvd" between the first ")" and the following "(" of the halves of the whole string OUTSIDE the parentheses so they won't be picked up as part of the strings ... advMatch() seems to work better if there is SOMETHING definite that seperates the two halves you want to split up ... are you sure the table is open like you think? You haven't tested it, but if your logic is correct, you should be getting either the view()'s or the msgInfo() for EVERY record of the table the way this is written. What about writing a bit of test code that let's you enter an address and test your match arg in advMatch() ... you could even make it so that you can enter the match arg string interactively too ... get it working right for a string you KNOW what you put in and then use that arg for your table. I attached a sample script to show you what I mean ... works on my Windows 98 machine running Paradox 10, but there's nothing I know of to stop it from running in almost any version of Paradox since version 5! Oh, I just noticed .... on your code, you have a return inside the else of your if statement ... that means, if advMatch() fails on the FIRST record of your table, the code stops! Bet that's the trouble ... also explains why you don't see msgInfo() for EACH record in your table (assuming you don't). |
![]() |
| Thread Tools | |
| Display Modes | |
| |