March 14, 200718 yr I have a list of records in Browse Mode (FM 8.5)and wish to create an A B C... listing on the footer so that when a user clicks on say... "C" the script will list immediately and moves to the first occurance of an Upper(Left([fieldname],1))="C" etc. etc. and redisplaying said records from the top of the screen. Would appreciate any ideas as I am still banging my head with some of the new elements of this version. Roy B
March 15, 200718 yr This is one of those things that has changed a lot. Left (YourField; 1) //Use your last name field for the YourField Your script will be something like: Set Error Capture [ On ] Enter Find Mode [ ] Set Field [ YourField; Get (ScriptParameter) ] Perform Find [ ] If [ Get (LastError) <> 0 ] Show Custom Dialog [ Title: "Warning"; Message: "No records found."; Buttons: “OK” ] Show All Records End If Next, attach the script to your buttons using the Script Parameter. Before v8, you would have to copy the script for each button. HTH Lee
March 16, 200718 yr Author Hello Lee; Thank you for the response however, being new to this, I am somewhat confused with the ScriptParameter area of: Set Field [ YourField; Get (ScriptParameter) ] If I have a footer menu... A - B - C.. Z, etc. and I attach the script to run on clicking say.. B, and the fact that you say you don't have to create a new script for each letter of the menu, how does the Perfom Find[] know which letter the user is clicking and to search for the first occurance of a Surname starting with the letter "B" ? Is there any simple learning aids or text out there that provides simpler explanations on how to use ScriptParams, etc. ? The help screens with FM 8 are written for people who know FM inside out. Regards, RB
March 16, 200718 yr Script parameters are basically values that you can pass along when your script is being called. You can typically pass a script parameter when assigning a script to a button or when you are calling a subscript from a script. In your button setup under the "specify script" section, there should be a 'Optional Script Parameter' entry box on the bottom. So for each button, pass the letter that you want as a parameter to the same script. i.e. First button "A", second button "B", etc etc. That way you will only need one script as Lee stated.
March 16, 200718 yr I can only add, The screen shot shows what we are saying, I hope. Note the "G" is where you will change the Script Parameter for each letter. HTH Lee Edited March 16, 200718 yr by Guest
March 16, 200718 yr Author Thank you Lee, now I get the drift, and it works. It displays however all records that contain the parameter (i.e. "G") within the fieldname chosen rather than displaying records where the parameter is equal only to the first letter of the fieldname. Any suggestions? Regards, Roy
March 17, 200718 yr Author Hello Lee; Marvelous what a little brain crunching does. I cured the problem... I created an ID_Alpa field that extracts the first letter of all surnames and placed that field in the SETFIELD search ScriptParameter. Works like a dream. Having said that I'm sure there's another way to do it without adding more resources to the file but I'm sure someone will advise me down the line. Many thanks. Chef Roy
March 17, 200718 yr Look at my first post again. [color:blue]Left (YourField; 1) //Use your last name field for the YourField I'm glad you got it figured out now. Feels good huh? Lee
Create an account or sign in to comment