{"id":1309,"date":"2014-02-21T11:13:51","date_gmt":"2014-02-21T11:13:51","guid":{"rendered":"http:\/\/bitmap2lcd.com\/blog\/?p=1309"},"modified":"2014-02-21T15:49:20","modified_gmt":"2014-02-21T15:49:20","slug":"bitmap2lcd-text-processing-functions","status":"publish","type":"post","link":"https:\/\/bitmap2lcd.com\/blog\/bitmap2lcd-text-processing-functions\/","title":{"rendered":"Bitmap2LCD : Text Processing Functions"},"content":{"rendered":"<p><strong><em>Bitmap2LCD is a tool for programming small Graphic LCDs in embedded systems and a programmable graphic and text processing tool.<\/em><\/strong><\/p>\n<p><strong>From Bitmap2LCD V2.9 and upwards<br \/>\n<\/strong><\/p>\n<h2><span style=\"color: #0000ff;\">Bitmap2LCD : Text Processing Functions<\/span><\/h2>\n<p>Note : Additional Processing functions will be implemented in the future<\/p>\n<p>The batch conditions and functions listed below, are available for programaticaly modifying the text editor content. A condition block (<strong>IF.. \/ WHILE..<\/strong>) can be followed by one or more functions (<strong>THEN..<\/strong>) A single condition block applies from the first to the last line to the whole text editor content. Next condition block again applies to the whole editor content&#8230;<\/p>\n<h2><span style=\"color: #ff00ff;\">Internal Batch System Variables<\/span><\/h2>\n<p>The batch system has internal variables holding informations such as :<\/p>\n<p><strong>Internal Index<\/strong> : The char index (or position) in the text editor line, where a &#8216;text&#8217; or an other data has been found. This internal index can be used in a following &#8216;then&#8217; function by letting &#8216;index&#8217; as it is next to the function (= no index number)<\/p>\n<p><strong>Internal Text Buffer : <\/strong>A text buffer where lines can be copied to<\/p>\n<p><strong>Current Hex Value<\/strong> : The last Hex value found for example by the <strong>get hex<\/strong> function<\/p>\n<p><strong>Hex Length Value<\/strong> : The Length of a hexadecimal value<\/p>\n<p><strong>Current Integer Value<\/strong> : The last Integer value found for example by the <strong>get integer<\/strong> function<\/p>\n<p><strong>Current Float Value<\/strong> : The last floating point value value found for example by the <strong>get float<\/strong>\u00a0 function<\/p>\n<p><strong>Current Flag<\/strong> : A boolean status flag ( True or false )<\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #ff00ff;\">Undefined Conditions<\/span><\/h2>\n<h2><strong>if unconditional<br \/>\n<\/strong><\/h2>\n<p>Unconditionally Set condition = True , execute list of functions on any text editor line<\/p>\n<h2><span style=\"color: #ff00ff;\">Hexadecimal Conditions and Functions <\/span><\/h2>\n<h2><strong>if hex in line\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/strong><\/h2>\n<p>Condition = True when a hex string (as user defined in the configuration settings ) is found in the line ( A hex value is defined by its prefix or suffix\u00a0 ( for example prefix like <strong>0x<\/strong> or<strong> $<\/strong> or a suffix like<strong> h<\/strong><\/p>\n<h2><strong>while hex in line<\/strong><\/h2>\n<p>Condition is and remains true while a hex value is found in the line, usefull for example, in a line of 16 hex values.<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>then get hex (index)<\/strong><\/h2>\n<p>If condition was True, gets the hex value specified by index ( first hex value index being index = 0 )\u00a0 <strong>Internal Index<\/strong> variable holds the char index where the hex value has been found.<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>then insert hex (index)<\/strong><\/h2>\n<p>If condition was True, Inserts the current hex value in string on position specified by index.<br \/>\nIf no numeric index specified, inserts hex on <strong>Internal Index<\/strong> value.<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>then overwrite hex<br \/>\n<\/strong><\/h2>\n<p>If condition was True, overwrites the current hex value in string on position on current index position.<\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #ff00ff;\">Text and\u00a0 Conditions and Functions<\/span><\/h2>\n<p>&nbsp;<\/p>\n<h2><strong>if &#8216;text&#8217; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/strong><\/h2>\n<p>Condition = True when the defined string under &#8216;text&#8217; is found in the line<\/p>\n<p><strong>Internal Index<\/strong> variable holds the index where &#8216;text&#8217;\u00a0 has been found.<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>if not &#8216;text&#8217; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/strong><\/h2>\n<p>Condition = True when the defined string under &#8216;text&#8217; wasn&#8217;t found in the line<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>while &#8216;text&#8217; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/strong><\/h2>\n<p>Condition is and remains true while\u00a0the defined string under &#8216;text&#8217; is found in the line<\/p>\n<p><em>Remark : The defined &#8216;text&#8217; might be deleted or modified in a function afterwards to prevent a loop without end.<\/em><\/p>\n<p>&nbsp;<\/p>\n<h2><strong>and &#8216;text&#8217;\u00a0 ,\u00a0 <strong>and not &#8216;text&#8217; ,\u00a0 or<\/strong><strong> &#8216;text&#8217; ,\u00a0 <\/strong>or not<strong> &#8216;text&#8217;\u00a0\u00a0 <\/strong><strong><\/strong><br \/>\n<\/strong><\/h2>\n<p>self speaking conditions, to extend\u00a0<strong>if<\/strong> conditions<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>then overwrite (index) &#8216;text&#8217;<br \/>\n<\/strong><\/h2>\n<p>If condition was True, overwrites text editor line from <strong>index<\/strong> position with specified <strong>&#8216;text&#8217;<\/strong><\/p>\n<p>Uses <strong>internal index<\/strong> value if index was&#8217;nt specified<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>then insert (index) &#8216;text&#8217;<br \/>\n<\/strong><\/h2>\n<p>If condition was True, inserts in text editor line from <strong>index<\/strong> position the specified <strong>&#8216;text&#8217;<\/strong><\/p>\n<p>Uses <strong>internal index<\/strong> value if index was&#8217;nt specified<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>then remove &#8216;text&#8217;<br \/>\n<\/strong><\/h2>\n<p>If condition was True, removes in the text editor line, the specified <strong>&#8216;text&#8217;<\/strong><\/p>\n<p>&nbsp;<\/p>\n<h2><strong>then delete until &#8216;text&#8217;<br \/>\n<\/strong><\/h2>\n<p>If condition was True, deletes chars in the text editor line from the <strong>internal index<\/strong> position to the position of <strong>&#8216;text&#8217;<\/strong><strong><br \/>\n<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #ff00ff;\">Line Number Conditions and Functions<\/span><\/h2>\n<h2><strong>if line number (index)<br \/>\n<\/strong><\/h2>\n<p>Condition = True if line number of text editor has been reached<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>if last line<br \/>\n<\/strong><\/h2>\n<p>Condition = True if last line of text editor has been reached<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>then delete line<br \/>\n<\/strong><\/h2>\n<p>If condition was True, deltes the current text editor line<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>then next line<br \/>\n<\/strong><\/h2>\n<p>If condition was True, jumps to the next line of text editor<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>then insert line<br \/>\n<\/strong><\/h2>\n<p>If condition was True, inserts a line at current line of text editor<\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #ff00ff;\">Flag Conditions and Functions<\/span><\/h2>\n<h2><strong>if flag \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/strong><\/h2>\n<p>Condition = True when flag was previously set <strong><\/strong><\/p>\n<p>&nbsp;<\/p>\n<h2><strong>if not flag \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/strong><\/h2>\n<p>Condition = True when flag was&#8217;nt previously set<\/p>\n<h2><strong>then set flag<\/strong><\/h2>\n<p>If condition was True, gets then sets the flag<\/p>\n<h2><strong>then set flag<\/strong><\/h2>\n<p>If condition was True, then clears the flag<\/p>\n<h2><strong>and flag\u00a0 ,\u00a0 <strong>and not flag ,\u00a0 or<\/strong><strong> flag ,\u00a0 <\/strong>or not<strong> flag \u00a0 <\/strong><strong><\/strong><br \/>\n<\/strong><\/h2>\n<p>self speaking conditions, to extend\u00a0<strong>if<\/strong> conditions<\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #ff00ff;\">Other Conditions and Functions<\/span><\/h2>\n<h2><strong>then save as &#8216;file&#8217;<br \/>\n<\/strong><\/h2>\n<p>If condition was True, then copies the content of the <strong>text editor as it is now <\/strong>to a filename defined under &#8216;<strong>file<\/strong>&#8216; <strong><\/strong>in the user defined<strong> Output Files Path<\/strong> ( Note : No path or folder allowed in &#8216;file&#8217; )<\/p>\n<h2><strong>then start delete<br \/>\n<\/strong><\/h2>\n<p>If condition was True, then sets a start of deletion flag at current text editor line<\/p>\n<h2><strong>then stop delete<br \/>\n<\/strong><\/h2>\n<p>If condition was True, then , if start delete has been found upwards in the text editor, deletes all the lines from Start to Stop delete position.<\/p>\n<h2><strong>then start copy<br \/>\n<\/strong><\/h2>\n<p>If condition was True, then sets a start of copy flag at current text editor line<\/p>\n<h2><strong>then stop copy<br \/>\n<\/strong><\/h2>\n<p>If condition was True, then , if start copy has been found upwards in the text editor, copies\u00a0 all the lines from start to stop copy position to the <strong>internal text buffer<\/strong><\/p>\n<h2><strong>then save copy as &#8216;file&#8217;<br \/>\n<\/strong><\/h2>\n<p>If condition was True, then copies the content of the <strong>internal text buffer <\/strong>to a filename defined under &#8216;<strong>file<\/strong>&#8216; <strong><\/strong>in the user defined<strong> Output Files Path<\/strong> ( Note : No path or folder allowed in &#8216;file&#8217; )<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>then load and insert &#8216;file&#8217;<br \/>\n<\/strong><\/h2>\n<p>If condition was True, then loads an external text file defined under &#8216;<strong>file<\/strong>&#8216; located <strong><\/strong>in the user defined<strong> Output Files Path<\/strong> and inserts the\u00a0 text into the text editor ( Note : No path or folder allowed in &#8216;file&#8217; )<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n\t<div class=\"quickshare-container\">\r\n\t<ul class=\"quickshare-genericons quickshare-effect-round quickshare-effect-expand quickshare-small\">\r\n\t\t<li class=\"quickshare-share\"><\/li> \r\n\t\t<li><a href=\"https:\/\/facebook.com\/sharer.php?u=https%3A%2F%2Fbitmap2lcd.com%2Fblog%2Fbitmap2lcd-text-processing-functions%2F&amp;t=Bitmap2LCD+%3A+Text+Processing+Functions+<+Bitmap2LCD+Software+Tool+Blog+%3A%3A+about+GLCD+displays+and+Programming\" target=\"_blank\" title=\"Share on Facebook\"><span class=\"quickshare-facebook\">Facebook<\/span><\/a><\/li>\t\t<li><a href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fbitmap2lcd.com%2Fblog%2Fbitmap2lcd-text-processing-functions%2F&amp;text=Bitmap2LCD+%3A+Text+Processing+Functions+<+Bitmap2LCD+Software+Tool+Blog+%3A%3A+about+GLCD+displays+and+Programming\" target=\"_blank\" title=\"Share on Twitter\"><span class=\"quickshare-twitter\">Twitter<\/span><\/a><\/li>\t\t<li><a href=\"http:\/\/pinterest.com\/pin\/create\/button\/?url=https%3A%2F%2Fbitmap2lcd.com%2Fblog%2Fbitmap2lcd-text-processing-functions%2F&amp;media=&amp;description=Bitmap2LCD+is+a+tool+for+programming+small+Graphic+LCDs+in+embedded+systems+and+a+programmable+graphic+and+text+processing+tool.+From+Bitmap2LCD+V2.9+and+upwards+Bitmap2LCD+%3A+Text+Processing+Functions+Note+%3A+Additional+Processing+functions+will+be+implemented+in+the%26hellip%3B\" target=\"_blank\" title=\"Share on Pinterest\"><span class=\"quickshare-pinterest\">Pinterest<\/span><\/a><\/li>\t\t<li><a href=\"http:\/\/linkedin.com\/shareArticle?mini=true&amp;url=https%3A%2F%2Fbitmap2lcd.com%2Fblog%2Fbitmap2lcd-text-processing-functions%2F&amp;title=Bitmap2LCD+%3A+Text+Processing+Functions&amp;source=Bitmap2LCD+Software+Tool+Blog+%3A%3A+about+GLCD+displays+and+Programming&amp;summary=Bitmap2LCD+is+a+tool+for+programming+small+Graphic+LCDs+in+embedded+systems+and+a+programmable+graphic+and+text+processing+tool.+From+Bitmap2LCD+V2.9+and+upwards+Bitmap2LCD+%3A+Text+Processing+Functions+Note+%3A+Additional+Processing+functions+will+be+implemented+in+the%26hellip%3B\" title=\"Share on Linkedin\" target=\"_blank\"><span class=\"quickshare-linkedin\">Linkedin<\/span><\/a><\/li>\t\t<li><a href=\"https:\/\/plus.google.com\/share?url=https%3A%2F%2Fbitmap2lcd.com%2Fblog%2Fbitmap2lcd-text-processing-functions%2F\" target=\"_blank\" title=\"Share on Google+\"><span class=\"quickshare-googleplus\">Google+<\/span><\/a><\/li>\t\t\t\t\t\t\t\t<li><a href=\"mailto:?subject=Bitmap2LCD+Software+Tool+Blog+%3A%3A+about+GLCD+displays+and+Programming:+Bitmap2LCD+%3A+Text+Processing+Functions&amp;body=https%3A%2F%2Fbitmap2lcd.com%2Fblog%2Fbitmap2lcd-text-processing-functions%2F\" target=\"_blank\" title=\"Share via Email\"><span class=\"quickshare-email\">Email<\/span><\/a><\/li>\t<\/ul>\r\n\t<\/div>\r\n","protected":false},"excerpt":{"rendered":"<p>Bitmap2LCD is a tool for programming small Graphic LCDs in embedded systems and a programmable graphic and text processing tool. From Bitmap2LCD V2.9 and upwards Bitmap2LCD : Text Processing Functions Note : Additional Processing functions will be implemented in the future The batch conditions and functions listed below, are available for programaticaly modifying the text [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[476,474,473,475,472],"class_list":["post-1309","post","type-post","status-publish","format-standard","hentry","category-source-code-postrocessing","tag-conditions-and-functions","tag-post-processing","tag-source-file-processing-function","tag-text-editor-processing","tag-text-processing-functions"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/bitmap2lcd.com\/blog\/wp-json\/wp\/v2\/posts\/1309","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bitmap2lcd.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bitmap2lcd.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bitmap2lcd.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bitmap2lcd.com\/blog\/wp-json\/wp\/v2\/comments?post=1309"}],"version-history":[{"count":48,"href":"https:\/\/bitmap2lcd.com\/blog\/wp-json\/wp\/v2\/posts\/1309\/revisions"}],"predecessor-version":[{"id":1357,"href":"https:\/\/bitmap2lcd.com\/blog\/wp-json\/wp\/v2\/posts\/1309\/revisions\/1357"}],"wp:attachment":[{"href":"https:\/\/bitmap2lcd.com\/blog\/wp-json\/wp\/v2\/media?parent=1309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitmap2lcd.com\/blog\/wp-json\/wp\/v2\/categories?post=1309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitmap2lcd.com\/blog\/wp-json\/wp\/v2\/tags?post=1309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}