Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Juggernaut

Featured Replies

  • Newbies

Hi

I want to move a database from Excel to FileMaker. I have most of the conversion sorted out, but one thing that I want to do is convert a field of up to 5 characters to morse code. I have this working well in Excel using the following formula:

=IF(MID(S2,1,1)="","",IF(MID(S2,2,1)="",VLOOKUP(MID(S2,1,1),Code!A:B,2),IF(MID(S2,3,1)="",VLOOKUP(MID(S2,1,1),Code!A:B,2)&" "&VLOOKUP(MID(S2,2,1),Code!A:B,2),IF(MID(S2,4,1)="",VLOOKUP(MID(S2,1,1),Code!A:B,2)&" "&VLOOKUP(MID(S2,2,1),Code!A:B,2)&" "&VLOOKUP(MID(S2,3,1),Code!A:B,2),IF(MID(S2,5,1)="",VLOOKUP(MID(S2,1,1),Code!A:B,2)&" "&VLOOKUP(MID(S2,2,1),Code!A:B,2)&" "&VLOOKUP(MID(S2,3,1),Code!A:B,2)&" "&VLOOKUP(MID(S2,4,1),Code!A:B,2),VLOOKUP(MID(S2,1,1),Code!A:B,2)&" "&VLOOKUP(MID(S2,2,1),Code!A:B,2)&" "&VLOOKUP(MID(S2,3,1),Code!A:B,2)&" "&VLOOKUP(MID(S2,4,1),Code!A:B,2)&" "&VLOOKUP(MID(S2,5,1),Code!A:B,2))))))

It's probably not the most compact code (!) but it works. It looks at each character in a cell (S2 in this case) and then does a lookup to another sheet (Code) for the equivalent value. It also makes sure that blanks are not added if there are less than 5 characters.

How do I go about doing this in FileMaker? I am not sure where to even start!

Many thanks in advance

J

BTW you could achieve this without a custom function if you want with just a substitute function in a calculation.

Substitute ( Upper(EnteredText); ["A"; ".-"]; ["B"; "-..."]; ["C"; "-.-."]; ... ["Z"; "--.."]; [" "; ""]

etc

Edited by Guest
Removed Left Function

Ahem... the Left() function seems a bit misplaced - assuming one wants the code for up to 5 characters, not 5 units of code.

Well, that was a big ooops... :

Technically, since the field is supposed to have 5 characters. The Left function is not even needed as long as the validation is done on the source field.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.