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.

Limitations to Code ( ) and Char ( )

Featured Replies

Text: 80 Character string

01234567890123456789012345678901234567890123456789012345678901234567890123456789

Calculation: Code = Code (Text)

results:

5000049000480001300057000560005500054000530005200051000500004900048000130005700056000550005400053000520005100050000490004800013000570005600055000540005300052000510005000049000480001300057000560005500054000530005200051000500004900048000130005700056000550005400053000520005100050000490004800013000570005600055000540005300052000510005000049000480001300057000560005500054000530005200051000500004900048

Code () only evaluates to 80 characters anything longer you get a question mark.

Another set of fields

A text field titled Num:P

Results input from above copied and pasted max out at 797 characters

57000560005500054000530005200051000500004900048000570005600055000540005300052000510005000049000480005700056000550005400053000520005100050000490004800057000560005500054000530005200051000500004900048000570005600055000540005300052000510005000049000480005700056000550005400053000520005100050000490004800057000560005500054000530005200051000500004900048000570005600055000540005300052000510005000049000480005700056000550005400053000520005100050000490004800057000560005500054000530005200051000500004900048000570005600055000540005300052000510005000049000480005700056000550005400053000520005100050000490004800057000560005500054000530005200051000500004900048000570005600055000540005300052000510005000049000480005700056000550005400053000520005100050000490004800057000560005500054000530005200051000500004900048

Char: Char( Num ) 160 returned characters

0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789

Also both functions evaluate the results in reverse order from the input the last value added to your input field becomes the first "set" of values in the results field.

With each concurrent entry the prior gets padded out to five characters the letter "z" = 122 and "zy" = 12100122 also typing in "00122" or "122" if it is the first value evaluates to "z"

s

Also both functions evaluate the results in reverse order from the input the last value added to your input field becomes the first "set" of values in the results field.

With each concurrent entry the prior gets padded out to five characters the letter "z" = 122 and "zy" = 12100122 also typing in "00122" or "122" if it is the first value evaluates to "z"

This is a feature, it is designed that way to allow you to easily step through the returned number using Div() and Mod() in the correct order.

I was told this was a standard in in the Unicode world, and the reason was some characters are encoded with 2 bytes (some accented or chinese scripts...) with no specific order.

I know it's of no help at all but it's all I know, sorry :

I don't think bytes have anything to do with this - we're not dealing with binary numbers here. Perhaps it would be useful to recall that the result of Code() is a number. The notion that individual numbers are padded with zeros can be quite misleading. What really happens is that the code point of the second character (counting from left, in the order of input) is multiplied by 10^5 and added to the first. The code point of the third character is multiplied by 10^10 and added to the previous result, and so on. The result is a SINGLE base-10^5 number written in decimal notation. This may APPEAR similar to padding, but in fact the code point of the last character is never "padded".

Another cool thing about Code(), is that script and local variables with repetitions can now be easily indexed by short strings, allowing a "structure" to faked.

I'm thinking something like:

Let( [$address[Code("street")] = "123 Penslyvania Dr";

        $address[Code("city")] = "Washington";

        $address[Code("state")] = "DC";

        $address[Code("zip")] = 78204

       ];

.....

)

This might allow some situations using indexed variables to be more self-documenting.

Edited by Guest

  • Author

This might allow some situations using indexed variables to be more self-documenting.

Very Intriguing!

BTW, beware of a misleading statement in the Help regarding accented and other composite characters:

When converting a composite character such as ä (an a plus a dieresis character), the
 function returns the Unicode code point for the composite character.

[b]Examples[/b]

...

Code(“ä”) returns 228.

The "(an [b]a[/b] plus a dieresis character)" part could be misunderstood to mean that the Code function also returns a single code point for the decomposed character (one that was entered in two keystrokes, an [b]a[/b] followed by a dieresis).

The correct statement is as follows:

When converting a precomposed character such as [b]ä[/b] (LATIN SMALL LETTER A WITH DIAERESIS), the Code function returns a single Unicode code point for the precomposed character (228). When converting the equivalent decomposed character [b]ä[/b] (LATIN SMALL LETTER A WITH DIAERESIS followed by COMBINING DIAERESIS), the function returns a distinct code point for each of the characters in the sequence (77600097).

[b]Examples[/b]

...

Code(“ä”) returns 228.

Code(“ä”) returns 77600097.

This also means that the number of distinct code points in the result of the Code() function does not necessarily reflect the length of the text.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.