Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Token is 'split' when using -lop=or

Featured Replies

I am using a token to build part of a find request. The token value is a field in my DB.

The problem is that the field may have more than one word in it, when it does the words in the field are split into different find requests. I have tried using RAW & URL encoding with no luck.

Any ideas?

Are you using quotes around the value? E.G:

<input type="text name="myfield" value="[FMP-CurrentToken]">

Good Luck.

Garry

[ February 13, 2002, 07:32 PM: Message edited by: Garry Claridge ]

I've just performed a test with [FMP-CurrentToken, url]. This works fine by replacing spaces with %20. However, the "CDML Reference" database shows the tag as:

[FMP-CurrentToken: url]

The : should be a ,

Hope this helps.

Garry

  • Author

Thanks for the quick replies.

Still not having any luck, here's the link i'm using and an explanation of what FM is doing.

FMPro?-DB=myDB&-Lay=Web&FieldOne=[FMP-CurrentToken:2,url]MyValueOne&FieldTwo=MyValueTwo&-Format=format.html&-Max=All&-LOP=or&-Find

This is what FM is doing...

FM is creating more than two find requests.

The first request places the first word in token.2 into FieldOne.

The second request places the second word from token.2 & MyValueOne into FieldOne.

The third request places MyValueTwo into FieldTwo.

What (I think) FM should be doing

FM should be creating only two find requests

The first request should be all the data in Token.2 & MyValueOne into FieldOne.

The second request should be the same as the third request obove.

This example assumes that the value of token.2 has two words in it.

  • Author

Thanks for the suggestions howerver...

I am not sure you understand my problem.

I am trying to perform a search that finds records with 'this data' from one field or 'some other data' from a different field. I don't need to perform a 'field content match' search.

The problem only happens when using the -LOP=or, using -LOP=and (the default if a LOP is not specified) doesn't 'split' my token, but it doesn't perform the find that I need.

I hope this is clear & i'm not missing something, i'm still learning this cdml stuff.

So it is only when the "-lop" is included. Hmm, I'll have a fiddle later on and see what I come up with.

All the best.

Garry

I think you are the one who does not understand. That is why I gave you a valuable reference. I spent six weeks finding that reference. Once I found it, it changed the way I handle things. I NEVER use a -lop or -op in a link or form action. I never have any problems. You are are the one struggling. You are the one with the problem.

I am using operators a lot. Never had a single problem. People sometimes mix logic with operators and then operators are for nothing.

  • Author

Nice post Keith... very helpful,

I read those articles again & fail to see what they have to do with my problem, the articles refer to performing exact content match when performing an -LOP=and search. Do you understand the difference between a 'and' & 'or' search?

Anatoli & Garry

Thanks for the replies, my search works fine as long as the value in my token is one word, so it isn't a mixed logic problem. I'm beginning to think that I will have to get rid of any spaces in the field that creates the token value.

Thanks for your help.

surwoop

"Do you understand the difference between a 'and' & 'or' search?"

Why yes, as a matter of fact I do. That is why I also would not use an "or" search. Sometimes what you want to do, what you think should occur, well, it just ain't so.

When you use an exact search you will get just that. When you need to search using one of the other symbols (found in the status bar) of the FMP db in a find operation, you can easily adapt the exact search to suit those needs. When you do an "or" search you can all to easily get records from either both or none when using the tags you insist on using. The "or" search is doomed to failure prima facie. The -op and -lop tags work best in If conditionals on Format Files to determine text to be displayed.

Sometimes you need to break your search into two or (ooooo, there's that word) more search opportunities. If you design that wisely your clients will not be offended.

Perhaps you could accomplish what you desire by running a ScriptMaker script. They can be run safely over the web if you know how. I know how. My web site uses them.

surwoop,

I have had a chance to do some tests. Unfortunately I didn't have any luck after inserting the '-lop=or', the request treated each word of one of the fields as separate searches. This is how the "CDML Reference" database describes it.

I am using FMP5.5v2

It is now head-scratching time looking for an alternative 'or' search on more than one field.

All the best.

Garry

[ February 14, 2002, 10:28 PM: Message edited by: Garry Claridge ]

I have created a calculated field which removes the spaces from 'FieldOne'; e.g. 'FieldOneTrim' = Substitute(FieldOne," ",""). This field can be used to assign the value to the token and then to be searched on.

Hope this is heading in the right direction.

Garry

[ February 14, 2002, 10:29 PM: Message edited by: Garry Claridge ]

Is research good for the soul?

"Logical operators evaluate multiple comparison expressions and return a Boolean result..."

That is from FileMaker Pro 4 Companion by Maria Langer, p. 362. This book can be useful to the FileMaker Developer. It is over 600 pages long. I strongly recommend reading it cover-to-cover. I did. It has information which has proved invaluable to me. There is more about the -lop "or". Buy the book and read it.

In Maria Langer's book "Database Publishing on the Web" page 283, she gives a description of using '-lop' for a multiple field search. However, the same problem will occur if the 'Last Name' entered was "Van Jones". The results would show:

"Van Smith", "Van Bloggs", "Van", "Jones" and "Van Jones" (and this is with using an 'exact' match on 'Last Name').

This is not the intended result.

Continually researching.

Garry

[ February 15, 2002, 01:10 PM: Message edited by: Garry Claridge ]

Garry,I think the key here is that we are trying to communicate with the database vis a vis the www. Sometimes it is necessary to understand how the database itself works. That is why I recommend understanding the exact search procedure as performed from the www - the references I give.

My experience is if you cannot write the code for a db find as adapted from those two referenced documents, then no mattter what cdml tags you use, you cannot perform that db find. When that is the case, you must break your find into two or more parts. It is that simple.

My experience is that the -lop and -op tags work best incorporated into unenhanced html when used in an If conditional on a format page to display text. And even then, you can probably do it another way which is more efficient.

By unenhanced html I mean no JavaScript. This is not meant as a slam at JavaScript (and we can thank Netscape not MS [which copied NN by creating JScript, much like they copied Windows from Apple, in spite of the judge's decision] for that language), for JavaScript truly has a place in the Developer's language. I would further suggest that if one can do it in html/cdml, it can be more easily enhanced by JavaScript.

If no one else has noticed, I believe that FMI's ads do make it seem that one can simply incorporate cdml into html. The reality is that the examples which FMI present all rely upon JavaScript - an added language which enhances, but is not inherent to html. I know because I tried to use their search example without the JavaScipt and, because it did not work, it put me on a six week search for those two documents. I would rather not discuss my feelings about FMI.

Keith,

Can you give an example of a two field "or" selection, with one of the fields containing words separated by spaces.

All the best.

Garry

Here is a general hint towards the pure cdml method:

[FMP-Record]

[FMP-If: Field:FieldOne .eq. CurrentToken:0]

....cdml/html....

[FMP-ElseIf: FieldTwo .eq. myValue2]

....cdml/html....

[/FMP-If]

[/FMP-Record]

[FMP-Record]

[FMP-If: Field:FieldOne .eq. CurrentToken:0 .or. Field:FieldTwo .eq. myValue2]

....cdml/html....

[/FMP-If]

[/FMP-Record]

However, a couple of practical hurdles need to be overcome before these will work properly.

I believe that using a calculated field to remove spaces in one of the search fields maybe easier and more efficient than the pure cdml method.

Being lateral.

Garry

Garry, no I cannot provide an example. I have never tried an "or". The reason I have not is because my understanding of the "or" is that it is fraught with problems even greater than an exact search.

The problems can be further exacerbated with a field containing two words.

I tend to start from the premise: Answer first how to tell Paul Simon the singer from Paul Simon the Senator from Paul Simon the Nobel winning economist. This example works as a basis for most find operations which I perform.

Sometimes one can have too many search criteria to be effective. That is why one must sometimes break things into parts. Even when constructing scripts they can get too long, complex and they must be broken into parts (sub-scripts).

When it comes to the symbols which are in the Status Bar of your db during a find, you will note that an "or" does not exist as a symbol. Generally speaking, I believe that one is most likely to use any of the first six symbols (FMP 5) in the dropdown list. Again, I would refer you to the code which I posted under the recent thread about currentdate as an example of use of the symbols. Just add pointy brackets. edit -> Oh yeah, set the date parameters in the db of that example for American dating mm/dd/yyyy.

Also under Turansky's currentdate thread I posted another reference for a symbol/code example which I had posted many months ago.

One possible help with an "or" might be to perform the search manually. Go to the db, scripts, edit, and save that search for your (previously written) script (I'm not looking, but I think the choice is "Replace")

Oh wait. That's right. I use scripts, but no one else does.

HTH

[ February 15, 2002, 10:07 PM: Message edited by: Keith M. Davie ]

Scripts are a feasible alternative. In fact, as we all know, they are very powerful.

However, if a script (or two or more different scripts) are called in a near-simultaneous manner, one script will run and at least one will not run. Yet all clients will be advised of a successful transaction. This is because the engine which reads ScriptMaker scripts is single threaded. Please tell me if you have seen the various problems expressed.

Do you have a way to handle the problems which can occur on a near-simultaneous request?

I do. That is what my site is about. And anyone can challenge my solution by following the instructions and Hints contained therein. I am not concerned that you will be misinformed. Nor am I concerned that, if you follow the directions and resubmit as requested, any data will be lost or mishandled. And if you don't resubmit, it means you changed your mind at the last opportunity. The latter is not a problem of the solution.

I believe using scripts is also a feasible alternative solution.

All the best.

Garry

surwoop, now that I have given you a very specific reference, do YOU understand the difference between an "and" and an "or"? What about an "xor"? Do you now know the meaning of Boolean? I have not heard back from you since I gave you that valuable resource. By your silence I trust that you have solved your problem. I would like to know how you handled it. Your providing that information would be, after all, fair to all future users of this valuable resource, the FM Forums.

  • Author

Hi Keith,

I havn't been able to reply to your posts because I have been away from my computer all weekend. Thanks for the reference to the book, I'll be traking it down.

As for the problem, i'm going to strip the field of any spaces, the example calculation field that Garry posted above should do the trick nicely.

Thanks again

Surwoop

Thanks for your response. Please keep us informed. I don't think I've sent you down a primrose path.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.