Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Is there something peculiar about the # character?


This topic is 4608 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a membership 'type' of Regular. I can, via script, change it to Regular#. OK.

But, if I run the same script to change it back to Regular it doesn't work. The get(foundcount) is 0.

Ideas?

Thanks

Ron

Posted (edited)

I have a membership 'type' of Regular. I can, via script, change it to Regular#. OK.

is this value from value list. To be a "UNIQUE" search for Regular#, you would need a cf i think or Delimit the ¶Regular#¶ in order to

find the exact match.

You are using teh repleacefieldcontents via script ? Why not just set a Flag or something rather than adding the # at the end?

-i

Edited by imoree
Posted

My application allows the user to define (in a portal) what their membership Types are. They are free to type in whatever they want.

I was just trying different things and I noticed that when I changed a previous Type to Type with a # that the ViewList would update but the find/replace functions would not. This seems to only happen with names that have #.

is this value from value list. To be a "UNIQUE" search for Regular#, you would need a cf i think or Delimit the ¶Regular#¶ in order to

find the exact match.

You are using teh repleacefieldcontents via script ? Why not just set a Flag or something rather than adding the # at the end?

-i

You are close. My script via 'onenter' collects the current $$PriorType name. Then onexit, it collects the $$NewType name. Next it does a search on $$PriorType. If the foundcount>0 it replaces $$PriorType with $$NewType. This find/replace function won't work if $$NewType has a # sign. Why? I don't know.

Posted

is this value from value list. To be a "UNIQUE" search for Regular#, you would need a cf i think or Delimit the ¶Regular#¶ in order to

find the exact match.

-i

Ian, what were the results when you tried doing exactly this and confirmed whether it worked before - yet again - submitting an untested and non-functioning suggestion?

Posted

Ian, what were the results when you tried doing exactly this and confirmed whether it worked before - yet again - submitting an untested and non-functioning suggestion?

Noted. .. Escape any filemaker special chars..

thanks

Posted

What about filtering the data directly in the field? if not i would use this to filter the data in the field via script:


Filter( FieldTO::Filter ; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvqwxyz1234567890" )

this will allow only capital and lowercase alpha chars and numbers 0 -9.

Posted

What about filtering the data directly in the field? if not i would use this to filter the data in the field via script:


Filter( FieldTO::Filter ; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvqwxyz1234567890" )

this will allow only capital and lowercase alpha chars and numbers 0 -9.

Thanks for the idea. But, when I type Able #, for example, eveything reverts to Able *until after the script is run* then I get Able # ???

Here is my little script:

If[get(triggerkeystroke)="#"]

show custom dialog

set field[MemberTypePopup::MbrType; filter (MemberTypePopup::MbrType; "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ")] This results in the # still showing after the script is run.

I have also tried SetField to "" and that command results in just #.

The confusing part for me is that after get(TriggerKeystroke)="#" recognizes the # character FM proceeds, after the script is run, to put the undesired character back into the field. What's the point of that?

Thanks

Ron

Posted

Check this out:http://sixfriedrice.com/wp/script-triggers-using-the-keystroke-trigger/

post-105143-0-40758300-1334046359_thumb.

Thanks for the idea. But, when I type Able #, for example, eveything reverts to Able *until after the script is run* then I get Able # ???

Here is my little script:

If[get(triggerkeystroke)="#"]

show custom dialog

set field[MemberTypePopup::MbrType; filter (MemberTypePopup::MbrType; "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ")] This results in the # still showing after the script is run.

I have also tried SetField to "" and that command results in just #.

The confusing part for me is that after get(TriggerKeystroke)="#" recognizes the # character FM proceeds, after the script is run, to put the undesired character back into the field. What's the point of that?

Thanks

Ron

this is what i tested & works for Only the # character; you can enter any other you want to escape

Posted

"My application allows the user to define (in a portal) what their membership Types are. They are free to type in whatever they want."

Huh? How do you report on membership types, then?

Posted

"My application allows the user to define (in a portal) what their membership Types are. They are free to type in whatever they want."

Huh? How do you report on membership types, then?

Good point!
Posted

The Type is field. It's contents come from popup list that refers to a table as it's source. To report on the Membership Types, I just refer to the Membership::Type field with a subsummry on Type.

How is this relevant to keeping the # character out of the Type portal field?

Posted

How is it NOT related? Nobody knows; and at this point it is impossible for anybody to know: you are being extremely unclear.

You said the type comes from a popup list; it restricted to limited values.

And you said that the type can be ANYTHING; including the user arbitrarily adding oddball characters to the field such as the # character.

Seems like time to upload an example or do a substantially better job of explaining the problem in detail.

Posted

Problem solved thanks to Imoree. He/she posted this link: Check this out:http://sixfriedrice.com/wp/script-triggers-using-the-keystroke-trigger/ which pointed out that, in my script, I needed to add Exit Script [False] which eliminates the trapped character.

As usual, this forum came through. Thanks to all who read and responded.

Posted

Ian

Check this out:http://sixfriedrice.com/wp/script-triggers-using-the-keystroke-trigger/

The FMForums provides a linking tool for this 9th icon, 2nd row.http://sixfriedrice....stroke-trigger/

or

if you had left a space between the "out:" and pasted it http://sixfriedrice....stroke-trigger/ it would have also provided an ability to click on it.

Posted

Ian

The FMForums provides a linking tool for this 9th icon, 2nd row.http://sixfriedrice....stroke-trigger/

or

if you had left a space between the "out:" and pasted it http://sixfriedrice....stroke-trigger/ it would have also provided an ability to click on it.

Great article. It really cleared up some 'fuzzy thinking' on my part about script triggers and their affects and sequences. Thanks for the links.

This topic is 4608 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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