Link.CaseCode - abrudz/Link GitHub Wiki

Normally, Link takes care of naming files for you. If case codes is on (default is off), each file name will have a case code (see below). However, if you have a BeforeWrite hook, Link will prompt your hook for a file name. If so, and case codes is on, your hook may want to add a case code to the generated file name. To make this ease, use this function to append a case code to any text.

What is a "case code"?

A reverse binary indication of the letter cases in the main part of the name, encoded in octal. For example

HelloWorld    ⍝ has the uppercase indication
1000010000    ⍝ which when reversed is
0000100001    ⍝ which is binary for
           33 ⍝ which in octal is
           41 ⍝ so the full name including case code is
HelloWorld-41

Arguments

  • name

Result

  • name with case code