Tour of the FM Solution
When you open the LiveCode for FM Solution you will see the Welcome screen
- Navigation - allows you to switch between layouts to access different features and functionality
- Functions testing area
- Forms testing area
- Custom Components testing area
- LCExec testing area
- LCEval testing area
- Licensing area - allows you to manage your LiveCode for FM license
- Intro video
- Forms button - opens the Forms pane of the Workspace. This is where you can view built in forms and create your own to use in your solution.
- Functions button - opens the Functions pane of the Workspace. This is where you can view built in functions and create your own to use in your solution.
- Custom Components button - opens the Custom Components pane of the Workspace. This is where you can view built in components and add your own to use in your solution.
LiveCode for FM (LCFM) allows you to tap into the full power of LiveCode to use in your FileMaker solutions.
By using the LCFM Workspace (workspace) you can define custom functions using the LiveCode Script programming language, create simple forms from a selection of control types and add custom windows by building content in the LiveCode IDE. Each of these individual pieces of functionality is called a component.
This lesson will take you on a tour of the LiveCode for FM Solution and Workspace.
The Function testing layout allows you to test functions, you can test built in functions or functions you have added in the Workspace.
When you first open the Functions area there is a default function showing a progress bar(1) and default parameters(2). This function shows a progress bar. Parameter 1 is the value to be shown on the progress bar, Parameter 2 is the width of the progress bar.
- The name of the function you want to test.
- The values of any parameters you want to send to the function.
- The value returned by the function.
- The script to run the function in FileMaker.
Let's try one of the built in functions, LCRandom. This function takes one parameter, an upper limit, and returns a random number between 1 and the upper limit.
Fill in the function name field with "LCRandom", and the 'Parameter 1' field with the number you want to use as an upper limit, I am going to use 1000.
Press Enter, or click outside the field, to run the function, the result is displayed in the 'Value as Container' field.
Note: You can see a complete list of the functions we have included for you by clicking on the "Functions"button, numbered as (5) in the top screenshot of this lesson.
The Form testing layout allows you to test forms, you can set the values of the form before showing it. The Forms testing layout allow you to test built in forms and forms you have created in the Workspace.
- The name of the form you want to test.
- The values to be set on the form, each control on the form is referred to by number. The values are set before the form is shown.
- The Run Form button shows the form as a dialog.
Let's try one of the built in forms, LCRating. This form shows a slider, allowing the user to enter a rating between 1 and 10.
Fill in the form name field with "LCRating", and the 'Control Value 2' field with the number to be initially shown on the slider. The LCRating form has 2 controls, Control 1 is a text display area and Control 2 is the slider.
Click the Run Form button to show the LCRating form, you will see that the slider is set to 3.
Click 'OK' to close the dialog.
The Custom Components testing layour shows a list of the Custom Components that available from via LiveCode for FM(1), and allows you to test them out.
Each custom component has its own testing area(2) which allows you to interact with the cusom components from the solution.
We will test the PDF Selection custom component. Select the PDF Selection example.
The PDF Selection component loads a pdf and allows the user to navigate around it. The user can select content in the PDF and extract the data in text or image form, which can then be used in your FileMaker solution.
Click on the 'Select Text' button (1), this opens the PDF Selection component with the sample PDF Loaded.
Select some text in the PDF and click the tick button. This will close the dialog and update the text field in the solution with the selected text.
The LCExec testing area allows you to execute a sequence of LiveCode Script commands from within your solution using LCExec.
- The sequence of LiveCode commands you want to execute.
- The values of any parameters.
- The value returned by LCExec.
- The script to run the script in FileMaker
We will write a short sequence of LiveCode Script commands that will tell us what day of the week a given date is.
Enter this code into the script field
put fmParam(1) into tDate
convert tDate to long date
return word 1 of tDate
- line 1 puts the value of parameter 1 into variable
- line 2 converts the format of the date to the long form - day name, month name DD, YYYY
- line 3 returns the first word in the date, which is the day name
Enter a date into the 'Parameter 1' field, in the form MM/DD/YY.
Click anywhere outside the field to run the script, the day of the week is shown in the 'Value as Container' field.
The LCEval testing area allows you to execute a LiveCode Script expression from within your solution using LCEval.
- The LiveCode expression you want to execute.
- The values of any parameters.
- The value returned by LCEval.
- The script to run the expression in FileMaker
We will test a simple expression that calculates the UK VAT on a given amount. UK VAT is currently charged at 20%, so we will calculate 20% of the value given in parameter 1.
Enter this code in the script field (1)
fmParam(1) * 0.2
Enter a value into the 'Parameter 1' field.
Press the Enter key to run the script, the VAT amount is shown in the 'Output' field.
This section provides links to the supporting resources for LiveCode for FM.
- Dicussion Forums - discuss LiveCode for FM in the dedicated forum.
- Lessons - step by step instructions for LiveCode for FM and LiveCode.
- Support - contact our support team.
- Roadmap - see the roadmap for the future of LiveCode for FM.
- User Guide - find out more about how to use LiveCode for FM.
- Report Issues - report any issues you encounter here.