Tour of the FM Solution

The LiveCode for FM Solution

When you open the LiveCode for FM Solution you will see the Welcome screen

  1. 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
    • Help
  2. Licensing area - allows you to manage your LiveCode for FM license
  3. Intro video
  4. 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.
  5. 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.
  6. 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.

Functions testing area

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.

  1. The name of the function you want to test.
  2. The values of any parameters you want to send to the function.
  3. The value returned by the function.
  4. The script to run the function in FileMaker.

Testing a function

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.

 

Forms testing area

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.

  1. The name of the form you want to test.
  2. 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.
  3. The Run Form button shows the form as a dialog.

Testing a form

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.

Custom Components testing area

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.

Testing a custom component

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.

LCExec testing area

The LCExec testing area allows you to execute a sequence of LiveCode Script commands from within your solution using LCExec.

  1. The sequence of LiveCode commands you want to execute.
  2. The values of any parameters.
  3. The value returned by LCExec.
  4. The script to run the script in FileMaker

Executing LiveCode script using LCExec

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.

LCEval testing area

The LCEval testing area allows you to execute a LiveCode Script expression from within your solution using LCEval.

  1. The LiveCode expression you want to execute.
  2. The values of any parameters.
  3. The value returned by LCEval.
  4. The script to run the expression in FileMaker

Executing LiveCode script using LCEval

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.

The Help section

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.

0 Comments

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.