Code:
;___________________________________________________________________________________________________________|
;
; Written By: Peter Jamtgaard copyright 2017 All Rights Reserved
;___________________________________________________________________________________________________________|
;
; Any use by unauthorized person or business is strictly prohibited.
;___________________________________________________________________________________________________________|
;
; Abstract: This routine allows the user to type Jumbo Text to the text screen
; There are limited characters (capital letters and numerals) and limited with to 7 characters
;___________________________________________________________________________________________________________|
;
; Command Line Function Header List
;___________________________________________________________________________________________________________|
;* C:JumboHelloWorld
;* Command Line Function to print Hello World to the text screen
;* C:JumboWord
;* Command Line Function to print a entered text string to the text screen
;___________________________________________________________________________________________________________|
;
; General Function Header List
;___________________________________________________________________________________________________________|
;* (CSVStringToList strText strChar)
;* Function to Convert a CSV String to List
;* (JumboCharacterTest strLetters)
;* Function to remove any unrecognized characters from the string and return a list of single character strings
;* (JumboLetterData)
;* Function to create a list of sublists that can be used to create jumbo letters
;* (JumboWord strLetters)
;* Function to print a string as jumbo letters to the text screen
;* (MatrixTranspose lstMatrix)
;* Function to Transpose a matrix (recursive)
;$ End Header
;___________________________________________________________________________________________________________|
;
; Command Line Functions
;___________________________________________________________________________________________________________|
;
; Command Line Function to print Hello World to the text screen
;___________________________________________________________________________________________________________|
(defun C:JumboHelloWorld ()
(JumboWord "Hello")
(JumboWord "World")
)
;___________________________________________________________________________________________________________|
;
; Command Line Function to print a entered text string to the text screen
;___________________________________________________________________________________________________________|
(defun C:JumboWord (/ strLetters)
(if (setq strLetters (getstring "\nEnter Text: "))
(JumboWord strLetters)
)
)
;___________________________________________________________________________________________________________|
;
; General Functions
;___________________________________________________________________________________________________________|
;
; Function to Convert a CSV String to List
;___________________________________________________________________________________________________________|
(defun CSVStringToList (strText strChar / intPosition lstStrings)
(while (setq intPosition (vl-string-search strChar strText 0))
(setq lstStrings (cons (substr strText 1 intPosition) lstStrings)
strText (substr strText (+ intPosition 1 (strlen strChar)))
)
)
(if lstStrings
(reverse (cons strText lstStrings))
(list strText)
)
)
;___________________________________________________________________________________________________________|
;
; Function to remove any unrecognized characters from the string and return a list of single character strings
;___________________________________________________________________________________________________________|
(defun JumboCharacterTest (strLetters / lstReturn)
(foreach intAscii (vl-string->list strLetters)
(if (or (<= 65 intAscii 90)
(<= 48 intAscii 57)
)
(setq lstReturn (cons intAscii lstReturn))
)
)
(reverse lstReturn)
)
;___________________________________________________________________________________________________________|
;
; Function to create a list of sublists that can be used to create jumbo letters
;___________________________________________________________________________________________________________|
(defun JumboLetterData ()
(mapcar '(lambda (X)(csvstringtolist X ","))
(list
"A,9, ### , ## ## , ## ## ,## ## ,######### ,## ## ,## ## "
"B,10,######## ,## ## ,## ## ,######## ,## ## ,## ## ,######## "
"C,9, ###### ,## ## ,## ,## ,## ,## ## , ###### "
"D,9,####### ,## ## ,## ## ,## ## ,## ## ,## ## ,####### "
"E,9,######## ,## ,## ,###### ,## ,## ,######## "
"F,8,######## ,## ,## ,###### ,## ,## ,## "
"G,9, ###### ,## ## ,## ,## #### ,## ## ,## ## , ###### "
"H,10,## ## ,## ## ,## ## ,######### ,## ## ,## ## ,## ## "
"I,5,#### , ## , ## , ## , ## , ## ,#### "
"J,8, ## , ## , ## , ## ,## ## ,## ## , ###### "
"K,8,## ## ,## ## ,## ## ,##### ,## ## ,## ## ,## ## "
"L,8,## ,## ,## ,## ,## ,## ,######## "
"M,9,## ## ,### ### ,#### #### ,## ### ## ,## ## ,## ## ,## ## "
"N,8,## ## ,### ## ,#### ## ,## ## ## ,## #### ,## ### ,## ## "
"O,9, ####### ,## ## ,## ## ,## ## ,## ## ,## ## , ####### "
"P,10,######## ,## ## ,## ## ,######## ,## ,## ,## "
"Q,10, ####### ,## ## ,## ## ,## ## ,## ## ## ,## ## , ##### ## "
"R,10,######## ,## ## ,## ## ,######## ,## ## ,## ## ,## ## "
"S,9, ###### ,## ## ,## , ###### , ## ,## ## , ###### "
"T,9,######## , ## , ## , ## , ## , ## , ## "
"U,9,## ## ,## ## ,## ## ,## ## ,## ## ,## ## , ####### "
"V,9,## ## ,## ## ,## ## ,## ## , ## ## , ## ## , ### "
"W,10,## ## ,## ## ## ,## ## ## ,## ## ## ,## ## ## ,## ## ## , ### ### "
"X,9,## ## , ## ## , ## ## , ### , ## ## , ## ## ,## ## "
"Y,8,## ## , ## ## , #### , ## , ## , ## , ## "
"Z,9,######## , ## , ## , ## , ## , ## ,######## "
"1,7, ## ,#### , ## , ## , ## , ## ,###### "
"2,9, ####### ,## ## , ## , ####### ,## ,## ,######### "
"3,10, ####### ,## ## , ## , ####### , ## ,## ## , ####### "
"4,9,## ,## ## ,## ## ,## ## ,######### , ## , ## "
"5,9,######## ,## ,## ,####### , ## ,## ## , ###### "
"6,10, ####### ,## ## ,## ,######## ,## ## ,## ## , ####### "
"7,8,######## ,## ## , ## , ## , ## , ## , ## "
"8,10, ####### ,## ## ,## ## , ####### ,## ## ,## ## , ####### "
"9,9, ####### ,## ## ,## ## , ######## , ## ,## ## , ####### "
"0,9, ##### , ## ## ,## ## ,## ## ,## ## , ## ## , ##### "
)
)
)
;___________________________________________________________________________________________________________|
;
; Function to print a string as jumbo letters to the text screen
;___________________________________________________________________________________________________________|
(defun JumboWord (strLetters / lstAscii lstJumboLetterData lstJumbos lstLetters)
(textscr)
(if (and (setq strLetters (strcase strLetters))
(setq strLetters (substr strLetters 1 7))
(setq lstAscii (JumboCharacterTest strLetters))
(setq lstLetters (mapcar 'chr lstAscii))
(setq lstJumboLetterData (JumboLetterData))
(setq lstJumbos (mapcar '(lambda (X)(cddr (assoc X lstJumboLetterData))) lstLetters))
(setq lstJumbos (matrixtranspose lstJumbos))
)
(foreach lstSublist lstJumbos
(princ "\n")
(princ (apply 'strcat lstSublist))
)
)
(princ "\n")
(princ)
)
;___________________________________________________________________________________________________________|
;
; Function to Transpose a matrix (recursive)
;___________________________________________________________________________________________________________|
(defun MatrixTranspose (lstMatrix)
(if (car lstMatrix)
(cons (mapcar 'car lstMatrix)
(MatrixTranspose (mapcar 'cdr lstMatrix))
)
)
)
(princ "!")
(vl-load-com)