Strict Programming Language

Strict Programming Language

  • Docs
  • API
  • Blog

›All Blog Posts

All Blog Posts

  • March 2023 Mutable
  • January 2023 Multi Line Text Expressions and Introducing New Lines in Strict
  • January 2023 Namings in Strict
  • December 2022 Traits and Components
  • November 2022 Multi Line List Expressions
  • November 2022 Strict Base and Example folders moved to separate repository
  • October 2022 Shunting Yard
  • September 2022 For loops
  • September 2022 Details about Mutability in Strict
  • July 2022 Introduction To Generics In Strict
  • May 2021 Strict Newbie Experiences
  • June 2021 Slow Progress
  • May 2021 BNF Grammar
  • May 2021 Next Steps
  • Jul 2020 Getting Back Into It
  • Jul 2020 Optimizing FindType
  • Jul 2020 Package Loading
  • Jun 2020 Parsing Methods
  • Jun 2020 As Simple As Possible
  • Jun 2020 Back to blogging
  • May 2020 Slow and not steady
  • Apr 2020 Sdk going open source
  • Feb 2020 Still work in progress
  • Jan 2020 website is up

January 2023 Multi Line Text Expressions and Introducing New Lines in Strict

January 18, 2023

Murali Tandabany

We added support for multi-line text expressions in Strict following the same approach we used to support multi-line List expressions. Along the same line, we also added support for New Lines inside text expressions. In this blog, we will discuss these both topics in detail.

Multi Line Text Expression

When you want to create a text expression with length more than 100 characters, it is very much possible that you are going to violate the Strict line length limitation which is any line with more than 120 characters in it are not allowed and the compiler will throw an error immediately. To resolve this problem, we are now introducing support for multi line text expressions for the text values with length more than 100 characters at least. If your multi-line text expression character length is below 100, then compiler will not parse this as multi line and throw a compile time error to use single text expression instead.

Creating a multi line text expression is very easy in strict. All you need to do is add a '+' operator at the end of the expression and continue the remaining part of the expression in the next line. Please be aware that you still need to end the text expression before '+' operator by using double quotes and also start the next line with the same tab level and a opening double quotes before continuing the remaining text expression values.

Example:

has log
Run
    constant result = "This is considered to be some interesting text data that has more than hundred character length" +
    "so it is continuing in the next line using strict multi line expression syntax"

It is recommended to use large text content stored in a text file and then load it into the strict program using File type instead of storing them in the program directly.

The below usage of multi-line text expression is not allowed as the line length is below 100 characters.

has log
Run
    constant result = "Has less than hundred character" +
    "so it is not allowed to get compiled"

New Lines in Text

Support for new lines is unavoidable in any programming language. Now, we have added support for New Lines in Strict Text values and in this section, we will discuss the syntax and usages of New Lines in Strict language.

The syntax to insert New Line is as follows,

Text.NewLine

This new line syntax can be used along with the text expression to insert a new line wherever required.

Examples:

has log
Run
    constant result = "First Line - Text data that has more than hundred character length" +
    Text.NewLine +
    "Third Line - so it is continuing in the second next line using strict multi line expression syntax" + Text.NewLine
Recent Posts
  • Multi Line Text Expression
  • New Lines in Text
Strict Programming Language
Docs
Getting StartedCoding StyleAPI Reference
Community
Stack OverflowProject ChatTwitter
More
HelpGitHubStar
Copyright © 2023 strict-lang