Jump to content

  •  

Photo

Script to show all entries beginning with a particular letter


  • Please log in to reply
5 replies to this topic

#1 Hyperscripter  newbie

Hyperscripter
  • Newbies
  • PipPipPipPipPip
  • 5 posts
  • FM Application:6
  • Platform:Mac OS X Snow Leopard
  • Skill Level:Novice

Posted 29 February 2012 - 12:13 PM

I am trying to write a script that will show all records that begin with ''a', all that begin with 'b', all that begin with 'c' etc. Each letter of the alphabet would have its own separate script (or all of them combined into one, if possible)

This searches cell 'Name' of every record for instances where the leading character is 'A' or 'a':


Sort [Restore,No dialog]
Show All Records
Go to Record/Request/Page [First]
Allow User Abort [On]
Loop
if ["Left(Name,1)="A""]
#Show this record The problem is here, I am looping through each record, and it determines the appropriate records alright, but how do I get it to display all of those records and only those records.
End If
Go to Record/Request/Page [Exit after last,Next]
End Loop
Go to Layout ["Table"]

If anyone can help me with this, I would really appreciate it. I know my way around FileMaker, but I am hardly accomplished. Most of my scripts rely heavily on my knowledge of AppleScript, to give you an idea. I am using FileMaker 6 on MacOS 10.6.8 (Snow Leopard)
  • 0

#2 comment  consultant

comment
  • Members
  • 24,212 posts
  • Time Online: 330d 22h 59m 48s

Posted 29 February 2012 - 12:20 PM

Why don't you use Perform Find?
  • 0

#3 Hyperscripter  newbie

Hyperscripter
  • Newbies
  • PipPipPipPipPip
  • 5 posts
  • FM Application:6
  • Platform:Mac OS X Snow Leopard
  • Skill Level:Novice

Posted 29 February 2012 - 12:44 PM

I have no idea how I could use Perform Find to show all of the records I want to display. I can see how I could use it to show all records that contain the letter a (in any position), but I want to display all records where the text in the cell I named "Name" begins with the letter 'a' or the letter 'b' etc.

How would I go about that, given that I am using FM6 ?
  • 0

#4 Lee Smith  I like the v13 layout tools

Lee Smith
  • Staff
  • 10,169 posts
  • FM Application:13 Advance
  • FMGo:iPhone / iPod Touch
  • Platform:Mac OS X Mavericks
  • Skill Level:Expert
  • Membership:TechNet
  • Time Online: 230d 7h 52m 36s

Posted 29 February 2012 - 01:14 PM

Automatic message


This topic has been moved from "FileMaker Product FamilyFileMaker LegacyFileMaker.fp5" to "Database Schema & Business LogicManaging Scripts".
  • 0

#5 Aussie John  wanna be master

Aussie John
  • Members
  • 597 posts
  • FM Application:12 Advance
  • Platform:Mac OS X Lion
  • Skill Level:Intermediate
  • Time Online: 3d 4h 51m 11s

Posted 05 March 2012 - 07:04 PM

perform find - enter the letter a, b or whatever into the criteria field and the script will just find records starting with that letter. no looping needed
  • 0
cheers John
--
advanced 12 Mac OS 10.7

#6 comment  consultant

comment
  • Members
  • 24,212 posts
  • Time Online: 330d 22h 59m 48s

Posted 06 March 2012 - 03:00 AM

given that I am using FM6 ?


Slightly off-topic: you are wasting your time learning version 6. There was a BIG change starting with version 7 and you will have a lot of unlearning to do when you upgrade.
  • 1




FMForum Advertisers