Operators Dialog / Operator Details

§ 12.11.84 - Script Settings Dialog

This dialog provides a means to set, save and load the syntax highlighting colors, specify the line wrap state, and access the presets dialog.

Tip: System variables (with the exception of void, true, and false) are named with the convention that all of their names begin with m_

I also use the convention that variables set in the presets have names that begin with u_ which makes certain that no variable I want to use in a main script such as x or b etc., will already be in use where it is not immediately obvious — actually right in the script I'm working with. This is a very useful approach, and I suggest that you use it, or something similar, as well.

Script settings dialog

§ 12.11.84.1 - The Script Presets Dialog

The Presets dialog allows you to create script blocks that are executed prior to every script, thereby allowing you to have handy preset variables and functions you can call on, making your scripts much easier to create. Here are some functions you can copy and paste into the presets dialog that I have set up, followed by an example of using some of them:

u_tt~"unset":u_xp=0:u_yp=0:u_tred=255:u_tgreen=255:u_tblue=255:u_xw=0:u_yw=0:u_matrix~""
xyset~"m_fontpoints=50;if(exists(font)==1);m_font~font;else;m_font~\"Marker Felt\";endif;if(exists(scale)==1);u_scale= scale;else;u_scale= 1;endif;u_yp= m_fontpoints * u_scale * 1.5;u_xp=u_yp * .33;u_yinc= u_scale * m_fontpoints * 1.25"
blackfill~"entire;colorfill 0 0 0"
rcolorfill~"func(rcolor);entire;colorfill u_r u_g u_b"
ctext~"text m_font u_xp u_yp u_scale u_tt;colorfill u_r u_g u_b;u_yp=u_yp+m_lineheight"
rcolor~"u_r= round(64+rnd(64));u_g= round(64+rnd(64));u_b=round(64+rnd(64))"
setrgb~"u_r=dparm(0);u_g=dparm(1);u_b=dparm(2)"
black~"func(setrgb0,0,0)"
green~"func(setrgb,0,255,0)"
white~"func(setrgb,255,255,255)"
whitetext~"func(white);func(ctext)"
greentext~"func(green);func(ctext)"
blacktext~"func(black);func(ctext)"
matout~"u_matrix~tparm(0);u_yw=arows(u_matrix);u_xw=acols(u_matrix);u_tt~\"matrix \"+u_matrix+\" @ \"+u_yw+\"y\"+u_xw+\"x\";func(greentext);u_tmp=m_fieldwidth;m_fieldwidth=maxdigits(u_matrix);u_tt~;if(u_xw>0);if(u_yw>0);uu_yp= 0;loop(u_yw);uu_xp= 0;u_tt~\"[\";loop(u_xw);u_dex=uu_yp*u_xw+uu_xp;u_v=value(u_matrix,u_dex);u_tt~u_tt+u_v;if(uu_xp<(u_xw-1));u_tt~u_tt+\",\";else;u_tt~u_tt+\"]\";endif;uu_xp=uu_xp+1;while();func(whitetext);uu_yp=uu_yp+1;while();endif;endif;m_fieldwidth=u_tmp"

Result generation with random background
Document Keyboard Navigation
, Previous Page . Next Page
t TOC i Index k Keyboard o Operators g Glossary c Changes

Valid HTML 4.01 Loose
 

This manual was generated with wtfm
wtfm uses aa_macro and SqLite
wtfm and aa_macro are coded in python 2.7
iToolBox 3.12
This Documentation and Associated Application Executables are Public Domain
Please consider supporting my iToolBox development efforts with a small PayPal donation.