LESSON IN COMPUTER PROGRAMMING, TEXTBT


Links
Todo
Notes
Flow Chart
SOLUTION
    Introduction

Here's a lesson in computer programming. The journey to realizing a code
to control the line length of text in a body of text. The lesson is presented
as a web page. The account begins today.

Background:

Bill began writing, a newsletter in 1988. To share news
of family activity to friends. Also to clear his head.
He typed small stories on a typewriter. After a short
time he began using a computer word processor. It was
cleaner and could be saved in a digital format.

He began studying web page design to disseminate the newsletter
via the web. It worked. With his programming and math and
drafting background it was easy to learn the method of
coding, called HTML to create web pages. One application
of which is a blog. He successfully published the newsletter.

Text consists of rows of lines of characters. To fit the text
of the newsletter between the element in the web page, Bill
had to manually insert a carriage return, before exceeding
the width of the element. Which he set at 500 pixels.
For each line. If he imported the text from another source,
such as an email message, he had to edit the text, line by
line.

It was his intent to create a program to automate the task,
short of finding a method or program elsewhere.



A flowchart is a type of diagram that represents an algorithm, workflow or process, showing the steps as boxes of various kinds, and their order by connecting them with arrows. Flowcharts are used in analyzing, designing, documenting or managing a process or program in various fields. Flowcharts are used in designing and documenting simple processes or programs. Like other types of diagrams, they help visualize what is going on and thereby help understand a process, and perhaps also find flaws, bottlenecks, and other less-obvious features within it. There are many different types of flowcharts, and each type has its own repertoire of boxes and notational conventions. The two most common types of boxes in a flowchart are: • a processing step, usually called activity, and denoted as a rectangular box • a decision, usually denoted as a diamond ........(Wikipedia) -see Flowchart, below.
    Notes
    Home

I'm making unusual progress today with my textbt() JavaScript to control text
line length in a web page element! This is the test string, sent from inside the
script into the web page. Following is the length in characters. It runs through
the string characters, constructing words, then lists of words to construct lines.
Lastly it constructs the string with line length defined carriage returns inserted.
I think my program is in an infinite loop. Working out the primary iteration. It's
tricky, takes a few stabs to perfect.

Pleased to report textbt should be online soon. This page is getting updated
today with yesterday's amazing progress. And it happened in Vegas.



24-March-2016 Hard at work on textbt. The "element", in which the text exists, as you see it on the screen in the first frame is automatically fit to the element width, by some magic associated with HTML, not controlled by me. The second element with text(a paragraph), is where the output goes and the text should not fill the element width, but be proscribed per the program's parameter. Say 66 characters. The element in my blog is 500 pixels wide, which 66 characters will optimally fit. The test page, and ultimately the output page, the element is 700 pixels wide. To distinguish between success and failure. Line 5 indicates the 1st "if" statement initiates, a space after "Larry". But Line 6 indicates something wrong with the loop, or it's an erroneous report.
Problem with code now is the loop. Must recall architecture of a loop. 1) Initialize index 2) State condition for termination 3) Function 4) Increment loop variable 5) Iterate Must make a check list.
    Home
The code in JavaScriptFlowchart


    Todo
    Home

  •  JS code attempted, in developement
  •  C++ downloaded to laptop
  •  Flow Chart started(sketched, preliminary)
  •  C++ interface examined
  •  C++ statements reviewed online, briefly
  •  Next: code in C++

20-March-2016 • Returned to JS code and making progress • Successful steps in JS, to "atom" • Reporting tests to web page via innerHTML, etc • Edited modified code draft • Solution optimistic, Web page <