Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

scripted find using local variable

 
   Database Forums (Home) -> FileMaker RSS
Next:  Help for user toolbar in a Form  
Author Message
jondavoren

External


Since: Feb 09, 2008
Posts: 1



(Msg. 1) Posted: Sat Feb 16, 2008 2:03 pm
Post subject: scripted find using local variable
Archived from groups: comp>databases>filemaker (more info?)

I'm working with Win Xp /FMPro Advanced 8.5v2

I'm trying to use a script to find all records containing a value less
or equal to the value of a variable.

I have a local variable ($A) set to some number and I need to find all
records with value less than or equal to $A in a given field.

When the script enters find mode and puts <$A then the find fails. It
looks like it actually searches for <$A rather than values less than
$A?

If I change the script to find all records with the field <5 it works
fine. Additionally if I set the script to find all records with $A in
the particular field the search works fine and returns all records
with exactly $A in that field.

Is there an easy way to have a scripted find for values less than or
equal to a local variable?

Any ideas would be greatly appreciated.

 >> Stay informed about: scripted find using local variable 
Back to top
Login to vote
Grip

External


Since: Apr 17, 2007
Posts: 396



(Msg. 2) Posted: Sat Feb 16, 2008 5:38 pm
Post subject: Re: scripted find using local variable [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Feb 16, 3:03 pm, wrote:
> I'm working with Win Xp /FMPro Advanced 8.5v2
>
> I'm trying to use a script to find all records containing a value less
> or equal to the value of a variable.
>
> I have a local variable ($A) set to some number and I need to find all
> records with value less than or equal to $A in a given field.
>
> When the script enters find mode and puts <$A then the find fails. It
> looks like it actually searches for <$A rather than values less than
> $A?
>
> If I change the script to find all records with the field <5 it works
> fine. Additionally if I set the script to find all records with $A in
> the particular field the search works fine and returns all records
> with exactly $A in that field.
>
> Is there an easy way to have a scripted find for values less than or
> equal to a local variable?
>
> Any ideas would be greatly appreciated.

You may be entering find mode and trying to set the variable all
within the same script step.

If that's the case, instead you want:

Enter Find Mode[]
Set Field[Field; "<" & $A]
Perform Find

 >> Stay informed about: scripted find using local variable 
Back to top
Login to vote
Helpful Harry

External


Since: Jun 23, 2003
Posts: 589



(Msg. 3) Posted: Sat Feb 16, 2008 11:00 pm
Post subject: Re: scripted find using local variable [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article
,
wrote:

> I'm working with Win Xp /FMPro Advanced 8.5v2
>
> I'm trying to use a script to find all records containing a value less
> or equal to the value of a variable.
>
> I have a local variable ($A) set to some number and I need to find all
> records with value less than or equal to $A in a given field.
>
> When the script enters find mode and puts <$A then the find fails. It
> looks like it actually searches for <$A rather than values less than
> $A?
>
> If I change the script to find all records with the field <5 it works
> fine. Additionally if I set the script to find all records with $A in
> the particular field the search works fine and returns all records
> with exactly $A in that field.
>
> Is there an easy way to have a scripted find for values less than or
> equal to a local variable?
>
> Any ideas would be greatly appreciated.

I would guess that you are using an incorrect command like:

Set Field [FieldName, "<=$A"]

which will give you exactly what you getting - records where the data
is less than the text "$A" itself because that's what you are telling
FileMaker you want.

Instead you have to use the concatenation operator "&" to join together
the text "<=" and the value stored in the variable $A.
eg.
Set Field [FieldName, "<=" & $A]

Note: "<=" can be left as it is or replaced with the combined 'less
than or equal' symbol - either will work in FileMaker (the combined one
just won't display in Newsgroup messages).


FileMaker can also be a little fussy about how scripts put data into
fields for Find mode, so you might have to try a different command to
Set Field.
eg.
Insert Calculated Result [FieldName, "<=" & $A]


Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
 >> Stay informed about: scripted find using local variable 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Simple scripted find question - I'm scripting a find, and I can't figure out how do the equivalent of checking the 'Omit' checkbox that's available in Find Mode. Any suggestions? Thanks, Kevin

Performing a find with a variable - Hi everybody. I am trying to perform a find doing the following: I have a portal with 3 records and I would like to select or find just one of the record from a row. For example, if I have A, B and C in a portal (3 records), each record has its own ID, I...

Find using global variable - I am fairly new to FileMaker Pro and I am using 8.5. I must preference this with telling you that my background is in VB and Access and I am having a heck of a time coming around to the FM way of doing things. I want to to have a dialog box ask the use...

scripted field to a file - Filemaker 8 on XP I have an big database of test results - mostly text fields but a few others. I created a calculated field and a script and built a web page of the results in another field. Now I can't figure out how to export it to a text file via...

How to OMIT and do a FIND of records in the same PERFORM F.. - Hi. We're using FM 8.5. We're trying to create a dialog box for users to enter a parameter which will then be used as part of the FIND. We've tried using the PERFORM FIND in a script. In pseudocode, here's what we're trying to accomplish IF (Field1 =..
   Database Forums (Home) -> FileMaker All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]