PERSONAl C# PUBLIC METHODS
For PC# Version 3.1
*********************************************
JavaScript Functions are listed at the bottom
*********************************************
cm()
=========
CONTAINING CLASS: pcs only.
USE: Handling Controls
COMMON INPUT: cs = Control's key name (example:"bt0")
COMMON OUTPUT: (i,j,k) based GUV's reset.
Additionally, after execution of modes "i" all (o) based
var's, all general use arrays and all var's used for control's
setup or installation are reset.
Also, after execution of mode "s", var's used to supply data
for each mode are reset.
REMARKS: (1) CONTROL KEY NAMES: You select one for each control you install.
It should be made of:
The 2-char name of the control + a number in the range (0-89)
The 2-char names can be:
Button:bt CheckBox:cb RadioButton:rb Label:lb TextField:tf
TextArea:ta RichTextBox:rt ComboBox:ch ls:ListBox pn:Panel
Menu:mn
See "Buttons Groups" and "Menu's" for more naming rules.
(2) THE SEUP METHOD: In your setup() method you supply the setup
data for each control then call cm("i") to install the control.
Your setup data may include default values which you like to
suggest on the user. The variables used to assign default values
to are the same update var's which are used to return latest update
of each control to your program See "Update variables".See mode
"i" for all setup data.
(3) UPDATE VAR's: Used by PC# to send updates to your program.
a) cus: Used for single item controls. For controls which generate
text like text fields, cus=the text. For "on/off" controls like
buttons, cus="1" or "0" indicating "on" or "off".
b) cui: Used for multiple item controls where user can select one
item only, like Radio Buttons and Combo Boxes. It stores the index
of selected item.
CUS[]: Used for multiple item controls where user can selsect more
than one item. Like Check Boxes and multiple choice lists. Each row
of array CUS[] can be "0" or "1".
(4) BUTTON GROUPS: Your program can include upto 9 CheckBox groups
and upto 9 RadioButton groups. Each group can include upto 10
buttons. Names should be as follows:
2-chr object name + group number (0:8) + button number (0:9)
For example: rb05=Radio Button number 5 in group 0.
and: cb21=Check Box Button number 1 in group 2.
All buttons are installed individually, can be modified
and their update status checked individually. However, You can
also check the update status for a group at once by using wild
card character, for example: cs="rb2*";cm("gu"); will get
the update for RadioButton group number 2. The update value
returned in this case will be the index of selected RadioButton in
the group assigned to (cui) In case of a check box, the update
value returned will be CUS[] as discussed before.
MODES:
Control's Installation:
-----------------------
i: USE:Install a control. This call should come from the method setup()
IN: cs=Control's key name.
ps=Containing Panel's key name. if not specified, control will be
directly installed on the form.
j,k=loc.(Center of control relative to Center of Form)
i,o=width,height of the control.
cls=foregroung-background combined color code for the control.
fns=Control's font code.
cis=Label's text
CIS[]=Items' text for a multi-item controls.
os=label alignment os=c/e/w/n/s/ne/nw/se/sw=Alignment direction.
ims=bckground Image file name or (="b") to use the image in (bip)
cts=tooltip text (appears when placing mouse curser at control)
cms=Context menu (appears when right clicking the control)
cas=Anchor=n/s/e/w
cds=Dock=n/s/e/w/f f=fill in all directions.
id=Tab index (control scan order when pushing TAB's
starting by 0) if id=-1 control will be skipped.
ob=editability. For tf,ta & rt: ob=true:Read only.
ib=Other boolean value. For tf: ib=true:means password txt field.
For buttons: ib=true means flat button.
For Panels:ib=true: means scrollable. For lists: ib=true means multi-item.
For Menu's ib=true:MainMenu ib=false:ContextMenu.
You need to state ib value for the root menu of each group only.
Additionally you may include (cus), (cui) and/or CUS[] to set
default return values (See Remark concerning "Update Var's" above.
REMARK: See "Common Output" for var's which are reset befor return.
ir: USE: Reset all installation parameters. You need to call this mode
before calling mode "i" if you have done an operation which could
have assigned value to any parameter and not sure that it has been reset.
in: USE: Prepare for installation of new controls. You need to call this mode
before calling setup() to install a new set of controls into the
form which will replace present ones.
it: USE: Install TextScreen.
iw: USE: Install WebScreen.
Controls' setup:
----------------
REMARK: See "Common Output" for var's which are reset befor return.
COMMON INPUT: cs=Control's keyname.
sB: USE: Set bounds IN: j,k,i,o=horiz, vert location & width, height
sA: USE: Set anchor IN: cas=one or more of: n/s/e/w (the 4 directions)
sD: USE: Set dock IN: cds=one only of: n/s/e/w or cds="f": fill.
sC: USE: Set color IN: cls=Foreground-Background combined code.
sF: USE: Set font IN: fns=Font code.
sc: USE: Set rich text current color IN: cls=color code.
sf: USE: Set rich text current font IN: fns=Font code.
sg: USE: Set background image IN: ims=Image file name or ims="b" meaning use (bip)
st: USE: Set tool tip IN: cts=tooltip text.
sn: USE: Set TAB order IN: id=TAB order for the comp. id=-1: Skip it
sl: USE: Set component label IN: cis=Label text.
sL: USE: Set Add to list for multi-item controls IN: CIS[]=Items to add.
sa: USE: Set label alignment IN: os=c/e/w/n/s/ne/nw/se/sw.
su: USE: Set (Force) an update value
IN : For tf,ta: cus=Update String. For cb, rb: cus="1" or "0" meaning
that the button should be selected or deselected.
For ch: either (cus) to set text or (cus="" & cui=Order of item to be selected)
For ls (single select): cui=Order of item to be selected.
For ls (Multiple select): CUS[]. Each row contains "1" or "0" to
select or deselect its corresponding item.
For bt: Calling cm("su") clicks the button (no value to supply)
sb: USE: Set bool value IN: ib=value Meaning depends on control type.
for bt's ib=true: means make it a flat button.
for tf's ib=true: means pswrd tf. (char's replaced with "*"'s)
for ls's ib=true: means Multi-selection ListBox.
for pn's ib=true: means Auto-Scroll Panel.
se: USE: Set editability IN: ob=value. For tf',ta,rt ob=true: Rd only txt
sE: USE: Enable/Disable a control IN: jb=true: means Disable control.
sx: USE: Set focus. OUT: ob. ob=true means operation was successful.
Reading Control's data:
-----------------------
gu: USE: Get last update (See Remarks)
OUT: cus=Current status, cui=index selected, CUS[]=cus for all elements
ge: USE: Get component editability OUT: ob=true: Read only. For (tf,ta,rt)
gx: USE: Get focus status. True if focusd OUT:ob
Other Operations done on Controls:
----------------------------------
O: USE: Returns a reference to the control object whose keyname is
supplied. The name of the reference var returned is the present
object name for the control type. Example: if cs="bt0" was
supplied, (btp) will be made a reference to bt0's object.
IN: cs=control's key name
Present Objects for Controls:
-----------------------------
Button: btp Label: lbp CheckBox: cbp RadioButton:rbp ComboBox:chp
ListBox: lsp TextField:tfp TextArea: tap RichTextBox:rtp Panel :pnp
ToolTip: ttp MainMenu: mmp ContextMenu:cmp
Additional public objects which you get by this mode:
-----------------------------------------------------
pno=Panel container for controls when multi-forms are used
TextScreen Objects: tfa, rta, pna, lba, mma
t: USE: Activate / Deactivate tooltTip IN: ob=true: Activate it.
Operations done on Form:
------------------------
REMARK: Whenever Form is resized, the default graphical device bitmap (bio) is
automatically scaled to match it in size.
ft: USE: Set Form's title. IN: os=Title's text
fv: USE: Make form visible/invisible. IN: ib. ib=true: make invisible
fe: USE: Eliminate Form. Console will then be used for input & output.
fcb: USE: Set form's background color. IN: cls=Color code
fcf: USE: Set form's foreground color. IN: cls=Color code
ff: USE: Set form's font. IN: fns=Font code
fi: USE: Draw form's Background Image. IN: ims=Image file.
fic: USE: Set Icon IN: ims=Icon file.
fa: USE: Turn AutoScroll feature on/off. IN: ib. ib=true: turn it on.
fam: USE: Set AutoScroll margins. IN: j=Horiz margin, k=Vertical
fk0: USE: Set Keyboard event handling level at zero. This means no events will be handled,
keyboard events will be used only by installed controls.
fk1: USE: Set Keyboard event handling level at one. This means that events will be handled
by method update(). Keyboard will have no effect on controls.
fk2: USE: (Not recommended) Do same as Level 1 and additionally disable all controls in order
to guarantee that that no keyboard events will be handled by them.
fbh: USE: Install horizontal Scrollbar and recreate (bio) to larger size horizontally.
IN : lf=Requested new width for (bio) in pixels.
fbv: USE: Install vertical Scrollbar and recreate (bio) to larger size vertically.
IN : of=Requested new height for (bio) in pixels.
fs: USE: Resize either Form Size or Form's ClientSize to (j,k) depending on value of (ib)
IN : j=new width, k=new height, ib="Which Size" flag. (ib=true) means ClientSize.
fsd: USE: Resize form to PC#'s Default Size which is 400 pixels height, full screen width.
fsf: USE: Resize form to fill the screen.
fwc: USE: Get ClientSize Width. OUT: of=Width in pixels.
fhc USE: Get ClientSize Height. OUT: of=Height in pixels.
fws: USE: Get max (full screen) Width. OUT: of=Width in pixels.
fhs: USE: Get max (full screen) Height. OUT: of=Height in pixels.
fmm: USE: Attach a main menu to form's top. IN: cms=MainMenu key name.
fmc: USE: Show Context menu at a location on form.
IN: cms=ContextMenu key name, j,k=Coordinates to show at.
REMARK: (j,k) are for menu's top left corner relative to Form's center.
Writing (form) to (bip) or to an image file:
--------------------------------------------
COMMON IN: fls=File name.
REMARK: We recommend supplying file's full path. If you supply name alone, you cannot
guarantee that the file will be saved into the current directory!
fw USE: Save Form to Present Bitmap Object (bip) OUT:bip
fwb USE: Save Form into "bmp" file.
fwe USE: Save Form into "emf" file.
fwx USE: Save Form into "exif" file.
fwg USE: Save Form into "gif" file.
fwi USE: Save Form into "icon" file.
fwj USE: Save Form into "jpeg" file.
fwm USE: Save Form into "MemoryBmp" file.
fwp USE: Save Form into "png" file.
fwt USE: Save Form into "tiff" file.
fww USE: Save Form into "wmf" file.
Active Mouse Cursor:
--------------------
ct: USE: Set Cursor type.
IN : ks=type. Can be (c/d/h/i/w) meaning (Cross/Default/Hand/IBeam/WaitCursor)
cp: USE: Set Cursor position.
IN : j,k=Position relative to (bio)'s center.
Displaying Dialogs:
-------------------
All Microsoft Dialogs return a character which indicates which button user has clicked on.
The character comes assigned to (oc) for all dialogs except for the Message Box which
returns the character assigned to (os)
The character can be one of (o/c/a/r/i/y/n) meaning that user has clicked the button:
(ok/cancel/abort/retry/ignore/yes/no)
d: USE: Display text in (os) into Microsoft's Message Box dialog. Also returns a code
into (os) indicating which button user has clicked.
IN: os=text to display js=Dialog title. oc=Dialog's icon. can be:
(none/x/?/!/i), oc=' ': means use (none)
ks=Keys selection. Can be (o/oc/ari/ync/yn/ri) Meanings: o=ok
oc=ok & cancel ari=abort,retry & ignore ync=yes,no & cancel
yn=yes & no ri=retry & ignore ks="" means use (o).
OUT: os os=(o/c/a/r/i/y/n) Meaning: User has clicked the button:
(ok/cancel/abort/retry/ignore/yes/no)
dcs: USE: Launch a custom dialog box and supply an "input" string to it.
IN: ks=Dialog Class Name. os=Input string. bli=Block to continue at.
js=Directory path where dialog class is. js="" means current directory.
OUT: os=Output string (coming from dialog)
dcr: USE: Called by the custom dialog class to receive the input string.
OUT: os=Input string (coming from calling class)
dco: USE: Called by the custom dialog class to send output string to calling class.
IN: os=Output string
dfo: USE: Display Microsoft's "Open File" dialog and obtain the name of the
file user has selected.
OUT: os=File name. oc=Key user has clicked. See above
dfs: USE: Display Microsoft's "Save File" dialog and obtain the name of the
file user has selected.
OUT: os=File name. oc=Key user has clicked. See above
dfb: USE: Display Microsoft's "Folder Browser" dialog and obtain the name of the
folder user has selected.
OUT: os=Folder Pathname. oc=Key user has clicked. See above
dt: USE: Display Personal C Sharp Text Dialog and set it for text display only.
IN : os=Text to be displayed. If it contains simple text like "Type your name"
the text will be displayed in B/W using default font. (os) can also contain
multiple instruction codes seperated with semicolons. The codes can be any
combination of:
CODE MEANING CODE MEANING
==== ======= ==== =======
l=String; Display a text line d=String; Display a Text string
c=ColorCode; Set Color f=FontCode; Set Font
g=ImageFile; Display an image
t=TextFile; Display text file content r=RtfFile; Display RTF file content
w=Width; Set Rich Text Box Width h=Height; Set Rich Text Box Height
dts: USE: Display Personal C Sharp Text Dialog and set it for text display with ability
to save the text into file or print it.
IN : os=Text to be displayed. Same as in mode "dt".
dti: USE: Display Personal C Sharp Text Dialog and set it for text display with ability
to receive a string of text from user and return it to calling program.
IN : os=Text to be displayed. Same as in mode "dt". bli=block to continue at.
OUT: os=Text supplied by user.
dtc: USE: Display Microsoft's "Color Selection" dialog and obtain a
reference to the selected Color object.
OUT: clp=Color object ref. oc=Key user has clicked. See above
dtf: USE: Display Microsoft's "Font Selection" dialog and obtain a
reference to the selected Font object.
OUT: fnp=Font object ref. oc=Key user has clicked. See above
_______________________________________________________________
dm()
=========
CONTAINING CLASS: pcs (All modes), pcs3 and pasp (Modes starting with h,p only)
USE: Defaults and constants setup
COMMON INPUT: ls = mode
COMMON OUTPUT: (i,j,k) based GUV's reset.
MODES:
hg: USE: Sets the highest number of elements a general use array can
handle.
IN: o = highest number allowed. A value of (o=0) sets the
original default number of (100) back
hb: USE: Sets the highest number of elements byte or char general use
arrays can handle.
IN: o = highest number allowed. A value of (o=0) sets the
original default number of (1000) back (see Remark 1)
ht: USE: Sets the highest number of threads which can be created.
IN: o = highest expected number. A value of (o=0) sets the
original default number of (10) back (see Remark 1)
hc: USE: Sets the highest number of controls which can be created in a class.
IN: o = highest number allowed. A value of (o=0) sets the
original default number of (100) back
hf: USE: Sets the highest number of files which could be opened in a class.
IN: o = highest number allowed. A value of (o=0) sets the
original default number of (100) back
hd: USE: Sets the highest number of records which a Table File can contain.
IN: o = highest number allowed. A value of (o=0) sets the
original default number of (1000) back
hw: USE: For class pcs3 only. Sets the highest number of WPF objects which can be archived.
An archived object is an object which has been created with specifing a keyname.
IN: o = highest number allowed. A value of (o=0) sets the
original default number of (110) back
fm: USE: Sets Multi-Form flag. You need to call this mode from method init()
with (ib=true) if your class contains more than one set of controls
which you will be installing into the form alternatively.
IN: ib = Multi-Form flag. ib=true means allow multi-forms.
ti: USE: Sets the default text input device from which user's
texetual input is read.
IN: os = device code. Default value: "s". Possible values are:
s = System screen (Console)
t = Text Screen input.
File name = A file you create, containing all
input necessary for your program in sequence.
to: USE: Sets the default text output device to which all texetual
output is sent, unless specified.
IN: os = device code. Default value: "s". Possible values are:
s = System screen (Console)
t = Text Screen (A RichTextBox) created and managed by PC#)
File name = A file to write all textual output to. If it does not
exist, will be created. If it exists, will be erased first.
p: USE: Get one of the initial parameters (Arg's)
REMARK: Param numbers start by 1. (i=0) returns program name.
IN: i=param. number. OUT: os=Param. value.
pc: USE: Get initial parameters count OUT: o=Count.
REMARK: Minimum count is 1 since program name is always available
as parameter number zero.
s: USE: Set initial form size.
IN : j,k=Width, Height in pixels. j=0 means max width, k=0 means max allowed height.
Operations done on Console:
---------------------------
REMARK: Console width is the max number of char's per line.
Console height is the max number of lines it can contain.
ccb: USE: Set Console's background color. IN: cls=Color code
ccf: USE: Set Console's foreground color. IN: cls=Color code
cs: USE: Resize Console to specified size. IN: j=new width, k=new height
csf: USE: Resize Console to fill the screen.
cwc: USE: Get Console's Current Width. OUT: o=Width.
chc USE: Get Console's Current Height. OUT: o=Height.
cws: USE: Get max (full screen) Width. OUT: o=Width.
chs: USE: Get max (full screen) Height. OUT: o=Height.
_____________________________________________________________________________
fm()
=========
CONTAINING CLASS: pcs, pcs3 and pasp.
USE: Filing
COMMON INPUT: ls = mode fls = File actual name.
COMMON OUTPUT: (i,j,k) based GUV's reset.
REMARKS: (1) When you open a Sequential Access File (SAF) you supply the
file actual name in (fls) & file keyname like "sf0" in (fs)
When you do any other operation on the file, you supply the
keyname only. Method fm() will obtain (fls) and other
informations regarding the files from its own archives.
(2) When you open a Random Access File (RAF) you do the same except
that reference name in this case must start with "rf", like "rf0",
"rf1" and "rf8".
(3) Maximum number of files allowed is 90 (total). However, you can
select keynames in the range (sf0:sf89) for your SAF's and any
keynames in the range (rf0:rf89) for your RAF's.
(4) The boolean value (dnb) "operation done indicator" is used
in filing to indicate that "end of file" has been reached. So, it
should be checked immediately after any read operation. If
found to be (true), there will be no more data to read.
(5) Remember to double the back slashes in file names. C# uses the '\'
to identify some special characters. For this reason, it expects
you to supply "\\" to mean "\". For example if your file path
was "C:\x.txt", supply its name as (fls="c:\\x.txt;)
GENERAL OPERATIONS ON FILES:
============================
MODES:
.: USE: Return current folder name in (os) OUT: os
A: USE: Obtains file attributes. IN: fls
OUT: os = one char (file attributes)
The character could be:
'space' = File name does not exist.
'd' = Found to be a directory.
'f' = Found to be a File.
M: USE: Makes(create) a new file/directory. If the file path supplied indicates that it
should be created into a nonexisting subfolder, the subfolder will be created.
IN: fls = file/directory name ks=type ks="f": File ks="d": Directory
C: USE: Copy one file to another. Not for folders.
IN: fls = Source file name os=Destination file name.
REMARK: If dest. file or directory exists, will always overwrite.
D: USE: Delete File or Directory.
IN: fls = file/directory name ks=type ks="f": File ks="d": Directory
L: USE: Get File List (Dir)
IN: fls = directory name followed with "\\"
ks="d": Get sub-directories only. ks="f" (default): Get files only
ks="a": Get all files of the entire directory tree.
OUT: OS[] containing the list.
REMARK: If you expect more than 500 items, use dm("hg") to increase OS[] capacity
or just redimention it as in: OS=new string[500];
F: USE: Find File. Searches for a file into one or more directory trees.
IN : fls= File to be found. May contain the '?' and '*' wild cards.
os = Root folder of the directory tree(s) to be searched. If more than one, seperate
with a ';'. Some root folders can be abbreviated to one char as follows:
d = "%SystemDrive%\\" (May translate to c:\\)
w = "%SystemRoot%" (May translate to c:\windows)
n = "%SystemRoot%\\Microsoft.Net" (.NET Directory)
p = "%SystemDrive%\\Progra~1" (Program Files directory)
r = "%SystemDrive%\\Progra~1\\refere~1" (Reference Assemblies directory)
OUT: OS[] = Pathnames of all flies found.
REMARK CONCERNING MODES R, RL, W, WL: The arrays which you load with data and supply to the
method when you write must not contain unused rows at their bottoms. Also, the arrays the
method returns to you when you read are dimensioned so that they contain no empty rows.
R: USE: Read all file as both text and binary IN: fls OUT:os,OY[]
RL: USE: Read all text lines of the file IN: fls OUT: OS[]
W: USE: Write all file with either the text in (os) or the binary data in OY[]
If OY[] is to be used, supply os="@". IN: fls, os, OY[]
WL: USE: Write all rows of OS[] into file as lines. IN: fls, OS[]
WA: USE: Append text to text file. IN: fls, os
X : USE: Export table file data by converting it into a "Comma Seperated Values (csv)" file.
IN : fls= Table File name. os= (csv) file name. kb= "Enclosing data in double quotes" flag.
kb=true means "enclose all data items in the (csv) file in double quotes".
OUT: The (csv) file containing the table file's data.
I : USE: Import data to a table file by converting a (csv) file made by others into a table file.
This mode accepts also importing some data items and ignoring the rest.
IN : fls= Table File name. os= (csv) file name. kb= "Enclosing data in double quotes" flag.
kb=true means "All data items of the input (csv) file are enclosed in double quotes".
j,k= Number of text lines at the top and bottom of the (csv) file (respectively) which
are not part of the data. Defaults: j=0 or k=0 means "No such lines found".
i = Number of data item per record to verify actual numbers found in each record with.
Default: i=0 meaning "Do not verify".
js = Contains "Source to Dest" item order number dictionary in case the the two files
don't have identical data item orders.
OUT: The table file containing the (csv) file's data.
O: USE: Get File Stream Object for a file
IN : fs=File Keyname OUT:fsp=Present FileStream Object ref.
s: USE: Access file search & browsing
IN: fls=Name of file to be searched fs=ref name (like "sf5")
c5=Last char. read.Supply "c5=-1" in 1st statemnt only to open file
js=String to skip ks=String to stop reading immediately before
j=Number of (js)'s to skip. If (js="" & ks="")
it means number of char's to skip.
OUT: os=String starting after last (js) and ending before start of (ks)
REMARKS: (1) If ks="", os="". File pointer will move to desired
position only which is immediately after (js).
(2) If js="", os=String starting at file pointer and ending
before the start of (ks)
(3) If (js="" & ks=""),os="". File pointer moves by (j) char's
GSF: USE: Get Special Folder path. You assign one of following 2-char codes to (os):
ck=Internet Cookies folder dt=Desktop folder fv=Favorites folder
ih=Internet History it=Internet Temporary folder pr=User Programs folder
mc=My Computer mm=My Music mp=My Pictures
rc=Most Recently used doc's st="Send To" menu items sm=Start Menu folder
su=Start up prog folder sy=System Directory md=My Documents folder
pf=Program Files folder cp=Common Program Files
OUT: os=Full path of requested folder.
SEQUENTIAL ACCESS FILES (SAF's):
================================
MODES:
or: USE: Opens a file for read only.
IN: fls=file name fs=keyname (like "sf0")
OUT: dnb=true: File is empty. EOF reached.
oa: USE: Opens a file for append. IN/OUT: Same as "or".
ow: USE: Opens a file for Read/Write. IN/OUT: Same as "or".
rl or r:USE: Reads text line. OUT: os, dnb=true: last data on file
ra: USE: Read all file OUT: os
rb: USE: Read one byte. OUT: o,os, dnb=true: last data on file
w: USE: Write text word. IN : os
wl: USE: Write text line. IN : os
wb: USE: Write byte IN: o
c: USE: Closes an open file.
RANDOM ACCESS FILES (RAF's):
============================
REMARKS: (1) RAF's can be with/without a header. To open a file without a
header you set ib=true and enter record length in (rcl) when
opening it. Your data starts at record zero in this case.
(2) RAF's with headers, contain all necessary information about how to
read their records and fields at record zero. You don't need to
supply record length except when you write the header. Your
data starts at record 1.
(3) To start a RAF with header, open it as "no header RAF", write the
header information and close it. From this point up, the file will
know how to read itself automatically.
MODES:
o: USE: Opens a file for Read/Write. If unavailable, will be created.
IN: fls=file name fs=keyname (like "rf0") ib=true: Open as a no
header file. rcl=Record length (necessary only when ib=true)
OUT: dnb=true: File is empty. EOF reached.
r: USE: Reads data for one record. IN: rci=Record number.
OUT: rcs=record data in a string form. dnb=true: last data on file
OS[],OD[]=Field data (for RAF's with headers only)
REMARK: If field no. x is a string, OS[x] contains the data and OD[x]=0
If field no. x is numeric, OD[x] contains the data and OS[x]
contains the same data in a string form formatted according to
field specs.
rh: USE: Read header record.
OUT: rcl=Record Length OS[],OD[]=Field names and types.
w: USE: Write a record.
IN: rci=record number, rcs=record data (for RAF's without headers) or
OS[],OD[]=Field data (for RAF's with headers) See Remark at mode"r"
wn: USE: Write at end of data ( write into first empty record available)
IN: rcs=record data (for RAF's without headers) or
OS[],OD[]=Field data (for RAF's with headers) See Remark at mode"r"
wh: USE: Write header data. File must be opened as "no header RAF" to use
this mode.
IN: OS[] containing field names in order, OD[] containing field type
codes in order.
REMARK: Here is how to find the field type code (od) for a field:
(1) If the field was numeric with (n) decimal digits, od=n/10
So, for an integer od=0 and for a 2 decimal digit number, od=0.2
(2) If the field was a string of (n) characters, od=n
So, for a field which can occupy a max space of 35 bytes, od=35
c: USE: Closes an open file.
TABLE FILES:
============
REMARKS: All PC# archives for Table Files are declared public, so you can access them. They are
created within mode 'o'. (rcs) is updated each time you read a record.
If your file keyname was "tb3", here is where to find data:
rcs : Last record read. This value is returned to you at mode "r" assigned to (os)
rcl : Record Length. This value is returned to you at mode 'o' assigned to (of)
fll : Total number of records (not only data record) Also returned to you at mode 'o'
assigned to (ol)
TBS[3][] : Stores a copy of the entire file.
CNS[3][] : Stores column titles.
CSI[3][] : Stores the start character order of each column.
CCI[3][] : Stores the number of characters each column contains
CNI[3] : Stores the number of columns in the file.
DSI[3] : Stores the record number of first data record. This is the record which immediately
follows the template record. Method fm("o") returns this value to you assigned to (o)
MODES:
o: USE: Opens a file for Read/Write. It copies file data to archives and also stores
field data into archives. File must exist and contain template record or it
will return an error.
IN : fls=file name fs=keyname (like "tf0")
OUT: o=Start data record number, ol=Total number of records(including pre-data records)
of=record length. dnb=true: File is empty (In this case o=ol)
fo: USE: Field Order. Get the column order number of the column whose title is assigned
to (ks) Column orders start at zero.
IN : ks=Column title.
OUT: o=Column order.
fs: USE: Field Search. You specify each field by its order number (Order starts by zero) and
a string of any number of characters at the beginning of the field to search for.
You'll receive the record number where each field is found. You assign all field
orders to K[] and all strings to search for to KS[]. All record numbers will be
returned to you assigned to O[].
If you prefer to search for a string which is not at the beginning of the field,
for example the 2nd char of the field (char # 1), assign (1) to array I[] at the
row number which matches the row numbers in K[] and KS[] for the field.
IN : K[] = Orders of the fields to search (order starts by zero)
KS[]= String to search for.
I[] = Order of char within the field to search at (Default:0)
OUT: O[] = Record numbers where each match was found. oi=Number of matches found"
fsb: USE: High speed field search using "binary search" approach. It requires the searched
IN : Same as with mode "fs".
OUT: O[] = Record numbers where each match was found. oi=Number of matches found.
erb = Error flag. If you try to "binary search" a field which is not sorted or
any other error has been encountered during search, (erb) will be set.
fS: USE: Sort data based on one field (Column)
IN : k=Order of column (Starts by zero), ib=sort type (ib=true means Do a numeric sort)
fp: USE: Purge File. Unifies record length of all data records. It can also add blank lines
to data to improve visibility if you assign value to (i)
IN : i=Repeated Interval to insert blank lines at. For example: (i=4) means make each
4th line a blank line.
r: USE: Reads data for one record. IN: rci=Record number.
OUT: rcs=record data in a string form. dnb=true: Record at or beyond end of file
OS[]=Field data. oi=Number of occupied rows in OS[].
w: USE: Write a record. Data will not be written into file until you call fm("c")
IN : rci=record number, OS[]=field data.
wn: USE: Write a new record at end of data.
IN : OS[]=Field data
d: USE: Delete a record. Deletion will not take effect until you close the file.
IN : rci=record number.
c: USE: Copies data back to file then closes it and resets archives.
_____________________________________________________________________________
COMMA SEPERATED VALUES (csv) FILES:
===================================
REMARKS: All PC# archives for (scv) Files are declared public, so you can access them. They are
created within mode 'o'. (rcs) is updated each time you read a record.
If your file keyname was "cf3", here is where to find data:
rcs : Last record read. This value is returned to you at mode "r" assigned to (os)
fll : Total number of records (not only data record) Also returned to you at mode 'o'
assigned to (ol)
CFS[3][] : Stores a copy of the entire file (after removing non-data records)
CFB[3] : Aboolean value which is assigned (true) if the file encloses data in double quotes.
MODES:
o: USE: Opens a file for Read/Write. It copies file data to archives after removing any non-data
record found at the top or the bottom of the file.
IN : fls=file name fs=keyname (like "cf0")
j=Number of non-data records found at top, k=Number of non-data records foud at bottom
i=Number of data items at each record (for verification purpose) Def:i=0:Don't verify.
OUT: o=Start data record number (always =1), ol=Total number of records after removing any
non-data record. dnb=true: File is empty.
fo: USE: Field Order. Get the column order number of the column whose title is assigned
to (ks) Column orders start at zero.
IN : ks=Column title.
OUT: o=Column order.
r: USE: Reads data for one record. IN: rci=Record number.
i=Number of data items at each record (for verification purpose) Def:i=0:Don't verify.
OUT: os=rcs=record data in a string form. dnb=true: Record at or beyond end of file
OS[]=Field data. oi=Number of occupied rows in OS[].
w: USE: Write a record. Data will not be written into file until you call fm("c")
IN : rci=record number, OS[]=field data.
c: USE: Copies data back to file then closes it and resets archives.
_____________________________________________________________________________
gm()
(of classes pcs and pasp)
=========================
CONTAINING CLASS: pcs and pasp.
USE: Graphics
COMMON OUTPUT: (i,j,k) based GUV's, o, of, od, ob, ad are reset.
REMARKS: (1) At startup, all graphics are rendered to (bio), "the default
graphical device" which is a transparent bitmap object, equal to
the form in size. (bio) is automatically drawn to the form
whenever it receives new graphics unless you turn the
auto-display mode off. It is also drawn to the form automatically
when the form is minimized then restored.
(2) At any point of your program, you can create a bitmap object and
set it to be your "graphical output device", replacing the
"default graphical output device".
From this point up, any drawing you do will be done on the new
bitmap surface until you change setup back to the default.
(3) You may use either cartesian or polar coordinates for defining
all locations. All measurments are relative to Form,s center.
X values go up as objects move to the right. Y values go up as
objects move up. Angles are positive when rotations are in the
anti-clockwise direction.
Cartesian: (jf,kf) = x,y values of object's center relative to
Form's center.
Polar: jf = radius kf = angle between radius and the x-axis in
degrees (0:360) kb = coordinate flag. kb=true means "polar".
(4) Shape objects are actually a "GraphicsPath" object to which the
shape has been added. (gpp) is always a reference to the present
shape object.
MODES:
GENERAL:
--------
d: USE: Display whatever is on the default bitmap. You don't need to use
this mode unless you have turned auto-display feature off
(see next)
dn: USE: Turn on / Turn off auto-display (Toggles) When auto-display is
turned off, you can display whenever you want with gm("d") Also
you can turn auto display back on by calling gm("dn") for the
second time. The reason you may need to turn auto-display off
is speeding up the execution of your program and prevention of
flickering during the formation of the drawing.
CTP USE: Convert Cartesian coordinates of one point to Polar.
IN : jf,kf= X,Y
OUT: of,ad=Radius, Angle.
CTC USE: Convert Polar coordinates of one point to Cartesian.
IN : jf,kf= Radius, Angle.
OUT: oxf,oyf= X,Y
MTO USE: Calculate (x,y) after moving center point to origin and rotating axes by (-ad) to
coinside with main axes.
REMARK: This is the reverse process of moving origin to a new location and rotating
axes.
IN : jf,kf = Original X,Y lf,of=center point coord's relative to origin.
ad= Angle which source axes make with main axes.
OUT: oxf,oyf = Resulting X,Y.
O: USE: Get references to all related objects. This includes (clp), (clo)
& (fnp) which correspond to current values of (cls) & (fns).
Here is a list of the public objects which you get:
---------------------------------------------------
clp,clo:1st,2nd color present objects fnp: font present object
grp:present Graphics object you use for drawing
gra:Graphics object for drawing on Form
spp,sbp:Pen & brush present objects lgp:LinearGradientPaint
tbp:TextureBrush present object rgp:PathGradientBrush(Radial G paint)
utp:Matrix (Affine transform) pdp:PrintDocument rnp:Present Region object
bip:Present Bitmap object bio:Default Bitmap object imp:Present Image object
iap:Present ImageAttributes object mfp:MetaFile mrp:EmfPlusRecordType
e: USE: Erase Present Graphical Output Device keeping it transparent.
ec: USE: Erase Present Graphical Output Device and paint it with a single
color.
IN : cls=single color code.
GRAPHICAL SETUPS:
-----------------
sps: USE: Create solid paint pen and brush objects.
IN : cls=Single color code. i=Pen/Brush width in pixels, default=1
OUT: Solid Pen and Brush created, refrenced to by spp & sbp
spl: USE: Create Linear Gradient paint brush object.
IN : cls=two color's code.
gpp=GraphicsPath object containing the shape to be painted
ad=Angle in degrees at which gradient runs accross shape
OUT: Linear Gradient Brush created, refrenced to by lgp
spr: USE: Create Radial Gradient paint brush object.
IN : cls=two color's code.
gpp=GraphicsPath object containing the shape to be painted
OUT: Radial Gradient Brush created, refrenced to by rgp
spt: USE: Create Texture paint brush object using (bip) graphics.
IN : bip=Present Bitmap Image object.
OUT: Texture Brush created, refrenced to by tbp
sdd: USE: Set the default display bitmap (bio) to be the Graphical output device.
sdb: USE: Set the present bitmap object (bip) to be the Graphical output device.
IN : jf,kf: Offset from center (optional)
sdm: USE: Set the currently open metafile to be the Graphical output device.
sc: USE: Set color using Image attributes. Mode "ba" applies the attributes
to (bip)
IN : oc=Attribute to set. Can be (m/c/g/t/o/x/w) meaning (Map Color to another/
Clear color range/Set Gamma/Set Threshold/Set Output channel/Set Matrix/
Set Textue brush wrap mode)
CLI[8]=Color component array.
For (oc='m') represente OldColor-NewColor.
For (oc='c') means MinComponentValues-MaxComponentValues.
jf: Has more than one definition.
For (oc='g') means gamma (01:5)
For (oc='t') means threshold (0:1)
js: Has more than one definition.
For (oc='o') means Output Channel. Can be (c/y/m/k) meaning
(Cyan/Yellow/Magenta/Black)
For (oc='x') means What to set. Can be (c/g/"") meaning
(Color/GrayScale/Both)
For (oc='w') means tiling plan. Can be (c/t/x/y/b) meaning
(Clamp/Tile/Reverse dir horizy/Reverse dir verty/ Reverse both dir's)
fls:For (oc='o') Color profile file path which can be used to calculate output
channel intensity. You may replace file path with file name only if it
is located into folder: %WINDIR%\system32\spool\color.
CMF[][] For (oc='x') Array to load matrix data into. Contains identity
matrix to start with.
ss: USE: Set the Stroke. Defines how lines terminate, how line joints
look like and the type of lines.
IN: string (sts) containing 3 char's as follows (default: sts="rrs"):
First char is the "End Cap Style Code" which can be:
b=butt s=square r=round
Second char is the "Join Style Code" which can be:
b=bevel m=miter r=round
Third char is the "Line Type Code" which can be:
s=solid d=dashed t=dotted b=both, dashed & dotted
sq: USE: Set graphics Quality. Defines how to perform each of the
following 4 operations:
t=text rendering s=smoothing c=composting i=interpolation
Each operation can be done as:"Default", "low quality-high speed"
or "high quality-low speed".
IN: js (0:4 chars long)=Concatenation of char's which represent the
operations to be performed at low quality-high speed.
ks (0:4 chars long)=Concatenation of char's which represent the
operations to be performed at high quality-low speed.
Operations which are not listed in either js or ks will be
performed at default quality.
EXAMPLE: js="c";ks="ti";gm("sq"); will cause "Compositing" to be done
at low quality, "Text rendering" & "Interpolation" to be done
at high quality and "Smoothing" to be done at default quality.
REMARK: All options are automatically selected to be done at
high quality-low speed. So, you need to access this mode only
if you like to lower the quality of performing some operations.
stu: USE: Set unit's Affine Transform.
IN : jf,kf=Original location of object to be transformed
lf,of=New location relative to original location (not relative to center)
jd,kd=Horizontal, vertical scale factors
id,od=Horizontal, vertical shear factors
ad=Rotation angle in degrees. Rotation is around object's center.
ib,ob:If you want created Transform to merge with original one in (utp),
set either (ib=true) causing new transform to be applied first
or (ob=true) causing original transform to be applied first.
ib=ob=false causes new transform to replace original one.
OPERATING ON THE PRESENT GRAPHICS PATH OBJECT (gpp):
----------------------------------------------------
Creating new Shape (GraphicsPath) objects:
------------------------------------------
General parameters for creating all objects (unless specified):
IN: (jf,kf) = Center location relative to form's center.
(lf,of) = Object's width and height.
(id,od) = Shear factors (if desired)
ad = Rotation angle (if desired)
REMARK: Adding 'd' to the end of the mode string means "draw object".
Addind 'f', means "draw and fill object".
OUT: gpp = Present Graphics Path object reference.
ca: USE: Create new Arc object.
IN: jf,kf,lf,of as expected and (jd,kd) = (Start angle, Arch angle)
cl: USE: Create new Line object.
IN: (jf,kf)=start point coordinates (lf,of)=end point coordinates
cr: USE: Create new Rectangle object.
IN: jf,kf,lf,of.
ce: USE: Create new Ellipse object.
IN: jf,kf,lf,of.
ct: USE: Create new Text object.
IN: (jf,kf) fns = Font os = Text
cp: USE: Create new Graphics Path object.
IN: JF[], KF[]=X,Y coordinates of all points relative to Path's center
j,k=Coordinates of Path's center relative to G Output Device's center
OF[] = Curvature of the connection between each 2 points. Zero
indicates a line. smaller value means more flat curve.
oi=Number of points.
c=: USE: Create Equally sided object.
IN: (jf,kf) = Coordinates of containing circle's center
of = Containing circle's diameter.
lf = Number of sides.
ci: USE: Get Image from file and draw it.
IN: fls=Image file name. i=Frame index (if multiframe file)
cc: USE: Create a Chart.
IN: JD[],KD[]= Data to be represented by the chart in (X,Y) directions.
i,o = Smallest Division Size in Pixels (default 10).
id,od = Smallest Division Size in Data.
j,k = Marked division size in smallest divisions (default 5).
js,ks = Marks Seperated with commas. To use Data instead, keep js="" or ks=""
hs,vs = Horiz & Vert Axes descriptions. A phrase to tell what each axis represents.
os = Chart Description. A phrase which will be displayed under the chart.
Drawing in 3D Space:
--------------------
cCd: USE: Draw a Cylinder with any equally sided object base.
IN : (jf,kf)=Location of cylinder center relative to Form's center.
lf= Number of base's sides. (lf=1) or (lf=2) draws a cylinder with line base which
is a rectangle.
of=Diameter of enclosing circle of the base.
id=Cylinder height.
js= Plane which base is parallel to. Can be "xy", "xz" or "yz".
cls=Combined color code for "visible lines" and "hidden lines".
ib="Show hidden lines" flag. Hidden lines will be displayed when (ib=true)
cPd: USE: Draw a pyramid with any equally sided object base.
IN : (jf,kf)=Location of Pyramid's center relative to Form's center.
lf= Number of base's sides. (lf=2) draws a pyramid with line base which is a plane
triangle.
of=Diameter of enclosing circle of the base.
id=Pyramid height. Negative height means pyramid is upside down (see examples)
js=Plane on which base sits. Can be "xy", "xz" or "yz".
cls=Combined color code for "visible lines" and "hidden lines".
ib="Show hidden lines" flag. Hidden lines will be displayed when (ib=true)
Working on 3D Assembly Files:
-----------------------------
The file name assigned to (fls) at modes "3rc", "3wc", "3cc" and "3rd" can be "@n". In this case
the methods will operate on the A3D number (n) instead of operating on a 3D Assembly file.
3rc USE: Read 3D Assembly's constants from an assembly file or an A3D.
IN : fls= Assembly file name or A3D number (See above)
OUT: oyf= Number of unit cylinders oxf=Number of sectors
os = Matrial code (Usable by WPF)
cls= Dual color code (Made to WPF specs)
oi = Order of first hollow unit cylinder. Numbering starts by 0 at the bottom.
(oi=-1) indicates a fully solid assembly.
3wc USE: Create a new 3D Assembly file and write these constants into it or create a new A3D
based on the constants.
IN : fls= Assembly file name.
o = Number of unit cylinders (Default=100) lf=No. of sectors (Default=dna*360)
ib = Hollow Assembly flag. (ib=true) means Hollow
js = (Optional) Matrial code (Usable by WPF)
cls= (Optional) Dual color code (Made to WPF specs)
i = Order of first hollow unit cylinder. Numbering starts at 0 for bottom cylinder.
If you supply (ib=false), (i) will be assigned (-1) indicating "Solid Assembly.
3cc USE: Create 3D Assembly file or an A3D for a cylinder.
IN : fls= Name of the file or A3D (See above) which will store cylinder's data.
o = Number of unit cylinders (Default=100)
lf = Number of sectors per unit cylinder.
of = Diameter of enclosing circle of the base (Drefault:100)
cls="Brightest-Darkest" double color code.
ib = Hollow Assembly flag. (ib=true) means Hollow
i = Order of first hollow unit cylinder.
id = Thickness in pixels. Meaningful only if (ib=true)
jd = Bottom diameter to center diameter ratio.
REMARK: If you set density at any value but 1, you should keep (lf) unassigned
so its value will be computed automatically (lf=360*dna)
3rd USE: Read 3D Assembly file and draw its content.
IN : fls = Assembly file path or A3D number (See above)
cls = "Brightest-Darkest" double color code.
(jf,kf) = Position of assembly's center relative to form's center.
(jd,kd) = Horizontal and vertical scale factors.
ad = Rotation angle around vertical axis of the assembly.
jb = If you make the assignment (jb=true) the reverse shading process of top
surface will be eliminated.
ib = If you make the assignment (ib=true) the assembly will be drawn upside
down. So, top unit cylinder will be at the bottom and unit cylinder
number zero will be at the top.
3cd USE: Display color code chart. When you assign "r" to the color code (cls), a rainbow of
colors will be used to identify each unit cylinder of the assembly. The standard
color code is used to identify 1st digit of each unit cylinder. This mode displays
the color code chart at any location which you select on the screen.
IN : (jf.kf): Center position of color chart relative to form's center.
Working on "Arrays of 3D Assembly Data" (A3D's):
------------------------------------------------
In order to improve processing speed, A3D's are used. An A3D is a 4-dimensional array of type
"double" which contains the same data which is found in a 3D Assembly file. Modes which handle
working on A3D's are identified by using upper case letters. The Array is in the form:
A3D[Array no.][Unit Cylinder no.][0/1 meaning outer/inner surface][Sector data]
Wanted density (dna) must be specified into method init() unless default is wanted (dna=1)
Default density means that no. of sectors=360 and diameter of enclosing circle=100.
A density of (0.5) means: no. of sectors=0.5*360=180 and diameter of enclosing circle=0.5*100=50.
COMMON IN : o : A3D number of output assembly (which is the main assembly)
i : A3D number of input assembly (which is a sub-assembly used to modify main-assy)
ks: Contains 4 numbers seperated with commas which describe an area to be modified:
1st no: Sector number at center of section to be modified of main assembly.
2nd no: Unit cyl number at center of section to be modified of main assembly.
3rd no: Width of section to be modified in pixels (Not used in some modes)
4th no: Height of section to be modified in unit cylinders.
ad: Angle in degrees which specifies the arch of the main-assembly section to be
modified or replaced. If you intend to replace the full assembly horizontally
assign (360) to (ad)
js: Contains 4 numbers seperated with commas which describe an area of sub-assembly
to be used to modify the main assembly:
1st & 2nd no's: Center location of area to be copied (in sectors and u cyl's)
2nd & 3rd no's: width in sectors and height in unit cyl's of area to be copied.
dd: Depth in pixels. Meaning is not the same in all modes.
3CA USE: Create a new A3D. Density (dna) must be specified at the top of the program.
IN : o = A3D number j=Number of unit cylinders
// Create a new A3D
3LF USE: Load Assembly file's data into an A3D.
IN : fls=File name, o=A3D number OUT: A3d[o][][][]
3AF USE: Modify A3D data in order to flatten an area on the assembly's surface and optionally
to add thickness to the flat area positively or negatively.
IN : o = A3D number.
oc = A code which describes the curvature of the area to be modified. Can be F/S/E
meaning: (Flat area) / (Section of a Sphere) / (Section of an Ellipsoid)
ks = Center location, width and height in pixels of area to be modified.
dd = Thickness to be added to flat area. (dd) can be +ve or -ve.
3AS USE: Modify A3D data by adding half a sphere to it.
IN : o, oc, ks (Same as in mode "3AF")
3AE USE: Modify A3D data by adding half an Ellipsoid to it.
IN : o, oc, ks (Same as in mode "3AF")
3AM USE: Modify A3D data by adding a sub-assembly which you specify its specs vertically and
horizontally in the two method GetX() and GetRadius()
IN : o, oc, ks (Same as mode "3AF")
js = Same data as in (ks) for the sub assembly to add.
3RS USE: Modify A3D data by replacing an area with a section of a sphere.
IN : o, ks (See above)
3RE USE: Modify A3D data by replacing an area with a section of an ellipsoid.
IN : o, ks (See above)
3RM USE: Modify A3D data by replacing an area with a sub-assembly which you specify its
specs vertically and horizontally in the two method GetX() and GetRadius()
IN : o, ks
3RQ USE: Modify A3D data by replacing an area of main assembly with a figure which is defined
by its vertical and horizontal cross sections with 2-char code in (os)
Vertical CS code can be: (r,t,c,=,e,h,p,s,H,m,d,$ or .) meaning:
(Rectangle,Trapezoid,Circle,Eq sided object,Ellipse,Hyperbola,Parabola,SuperEllipse,
Heart symbol,Your method,Delete only,Sketch or Do not modify)
Horizontal CS code can be: (r,c,=,e,R,g,m,d,$ or .) meaning:
(Rectangle,Circle,Eq sided object,Ellipse,Rose Curve,Gear Curve,Your method,
Delete only,Sketch or Do not modify)
IN : o=A3D number of main-assembly.
os=2-char code which specifies the shapes of vertical and horizontal cross sections.
ks=See above. The width in this case is the raw width (or radius of encl circle) of
of replacement assembly.
ad=See above.
jd,kd= Additional parameters which vertical cross section's equation may require.
id,od: Additional parameters which horizontal cross section's equation may require.
3RA USE: Replace a section of main-assembly with a section of sub-assembly.
IN : o=A3D number of main-assembly.
i=A3D number of sub-assembly.
ks=See above. The width in (ks) is unused in this mode.
ad=See above.
js=See above.
ld=Displacement of sub-assembly's center from main-assembly's center. Notice that
this displacement is expressed in polar coordinates. The radius is (dd) and the
angle is the first number in (ks)
kb=Lock-on flag. (ib=true) causes main-assembly surface to lock on sub-assembly
surface from all directions leaving only portions of sub-assembly which extend
beyond it to be exposed.
ib=Hollow Assembly Flag. ib=true means hollow assembly wanted. dd,j must be assigned
dd=Thickness of the hollow assembly. j=Starting hollow cylinder
3SF USE: Save A3D data into file.
IN : fls=File name, o=A3D number.
ib = Hollow Assembly flag. Assign it (true) if you want a hollow assemby.
i = Order of first hollow unit cylinder.
Operations done on (gpp):
-------------------------
COMMON INPUT / OUTPUT: gpp = Present GraphicsPath object
jf,kf= Object's center relative to G Out Device's center.
grd USE: Render-draw (gpp) as is to present graphical output device.
grf USE: Render-fill (gpp) as is to present graphical output device.
gt USE: Transform (gpp) applying present Unit Affine Transform (utp) and
make (gpp) the reference of the resulting object.
IN: utp: Present "Unit's Affine Transform" object.
gtd USE: Do the same as in mode "gt" then draw the resulting (gpp)
IN: utp: Present "Unit's Affine Transform" object.
gtf USE: Do the same as in mode "gt" then draw-fill the resulting (gpp)
IN: utp: Present "Unit's Affine Transform" object.
grs USE: Render-fill (gpp) using 3D Special effects
IN: ks=Special Effect type. ks="r": Reflection ks="d": Depth.
For (Reflection) only: cls=Single Color code.
of=Brightness factor (1:5) default:2.5
For (Depth) only: cls="Brightest-Darkest" double color code
id=Depth in Pixels, ad=3D angle.
OUT For (Depth) only: oxf,oyf = Center coordinates of top surface.
gc USE: Set (gpp) as a clip area for (grp)
gc+ USE: Add (gpp) to current clip area.
gc- USE: Subtract (gpp) from current clip area.
gc& USE: Modify current clip area by intersecting (gpp) with it.
gc^ USE: Modify current clip area by Xoring (gpp) with it.
gcn USE: Reset Clip area. Cancel previous clip area setup.
Obtaining measurments for (gpp):
--------------------------------
COMMON INPUT: gpp: Present GraphicsPath object.
COMMON OUTPUT: os: The type "float" value returned. Note that we could not
use (of) instead since method gm() uses (of) for input and
resets it at the end.
gw USE: Return the width of the containing rectangle of (gpp) in (os)
gh USE: Return the height of the containing rectangle of (gpp) in (os)
gx USE: Return the x-value of the top left corner of the containing
rectangle of (gpp) relative to the output device's center.
gy USE: Return the y-value of the top left corner of the containing
rectangle of (gpp) relative to the output device's center.
OPERATING ON THE PRESENT BITMAP OBJECT (bip):
---------------------------------------------
Creating new (bip):
-------------------
bn USE: Create a new Bitmap object and assign its reference to (bip)
IN : lf,of=Width, Height
blf USE: Load Image file and create (bip) from the resulting image object.
IN: fls: Image file name i=Frame Index (If multiframe file)
lf,of=Wanted size. lf=of=0 means full scale
OUT: os: Contains Total number of frames the file contains.
bR USE: Get Horizontal and Vertival Resolution of Bitmap (bio) in Pixels/Inch
IN : oxf,oyf
Obtaining GraphicsPath object (gpp) of an image:
------------------------------------------------
bg USE: Obtain (gpp) which represents the outlines of an image.
IN: fls=Image file name. dna=Density (Default=1)
OUT: GraphicsPath object (gpp) which represents image outlines.
Modifying (bip):
----------------
bb USE: Blur (bip) This operation is slow. Use blur factors in the range 1:5 only.
IN: k=Blur factor
bcg USE: Get Color information at one pixel in (bip)
IN: jf,kf=Pixel location relative to image's center.
OUT: CLI[4] The 4 color components at specified pixel.
bcs USE: Set Color of one pixel.
IN: jf,kf=Pixel location relative to image's center.
CLI[4] The 4 color components to set at specified pixel.
OUT: (bip) modified.
Transforming, modifying and rendering (bip):
--------------------------------------------
COMMON IN: bip: Present Bitmap object.
ba USE: Apply Present ImageAttributes to (bip)
brc USE: Adjust mouse coordinates when clicked on drawings which have been rendered on (bio)
in order to compensate for the relocation of Form's center due to resizing. Or
if (ib=true), do the opposite, meaning receive coordinates based on original size
of Form and modify it so it fits either the regular or maximized Form sizes.
IN/OUT: oxf,oyf=Mouse coordinates. IN:ob=Modification direction.
br USE: Render (bip) to the graphical output device as is.
IN : jf,kf: Desired (bip)'s center location relative to form's center.
brt USE: Render (bip) to the graphical output device while applying the
current Unit's AffineTransform (utp) to the object.
REMARK: jf,kf must not be assigned values. (utp) should include location
setup.
IN: utp: Present "Unit's Affine Transform" object.
Displaying (bip) independantly from (bio):
------------------------------------------
REMARKS: These modes display (bip) atop (bio) without blending the two together. Mode "bdn"
stops the display of (bip) making (bio) shows up alone. If you have installed scrollbars
mode "bd" makes (bip) and (bio) scroll together; mode "bdf" makes (bip) stationary.
bd USE: Display (bip) relative to (bio) (without blending with it)
IN : jf,kf: Desired (bip)'s center location relative to (bio)'s center.
bdf USE: Display (bip) relative to Form.
IN : jf,kf: Desired (bip)'s center location relative to Form's center.
bdd USE: Display (bip) docked to one edge of the Form. (ds) assignment sets where to dock
It can be assigned (n/s/e/w/ne/nw/se/sw/c) Default is c (Center)
IN : jf,kf: gap to leave between (bip)'s edge and the Form's edge it docks with.
Examples: ds="w";jf=20; Sets it 20 pixels away from left side. ds="e";jf=-20 sets
it 20 pixels away from right side.
bdn USE: Stop displaying (bip)
bdc USE: Receives one point coordinates in (oxf,oyf) which are relative to (bio)'s center and
modifies it so that it becomes relative to (bip)'s center.
IN/OUT: oxf,oyf
Saving (bip) into file:
-----------------------
COMMON IN: fls=File name.
REMARK: We recommend supplying file's full path. If you supply name alone, you cannot
guarantee that the file will be saved into the current directory!
bs USE: Save (bip) into file (fls) using the encoder parameters specified. If multi-frame
file specified, all bitmap images stored into array BIP[] will be stored into file.
IN : i=Color depth (number of bits/color) k=Quality factor (0:100)
ks=Compression scheme. Can be "none", "rle", "lzw", "ccitt3" or "ccitt4".
ib=Multi-frame flag. ib=true means multi-frame.
bip or BIP[]=Bitmap(s) to be stored into a single or multi-frame file respectively.
bsb USE: Save (bip) into "bmp" file.
bse USE: Save (bip) into "emf" file.
bsx USE: Save (bip) into "exif" file.
bsg USE: Save (bip) into "gif" file.
bsi USE: Save (bip) into "icon" file.
bsj USE: Save (bip) into "jpeg" file.
bsm USE: Save (bip) into "MemoryBmp" file.
bsp USE: Save (bip) into "png" file.
bst USE: Save (bip) into "tiff" file.
bsw USE: Save (bip) into "wmf" file.
OPERATING ON METAFILES:
-----------------------
mor USE: Open file for read. Immediately after this call, method update() will be receiving
record data one by one with the assignment (cs="mf")
IN : fls=Metafile name or path.
jf,kf=Coord's of destination point to desplay file at (using center positioning)
OUT: See mode "mr".
mow USE: Open for write.
mr USE: Display this record and keep reading next records one by one.
OUT: bli=Number of the block this record belongs to. jb=EOF flag. jb=true: End of file.
ob=Block label record flag. ob=true: This record is a block label record.
mrp:Type of record of=Metafile flags. od=Data size OY=Data
mrb USE: Fast forward through the file until the label record for (bli) is found, then
return record data with (ob=true) to indicate that this is a block label record.
OUT: Same as mode "mr".
mwb USE: Write a new block label record into file
IN : bli=Block number.
mc USE: Close file.
PRINTING:
---------
po USE: Open a new Printing operation.
Obtaining setup values:
-----------------------
All measurments are in (1/100)th of an inch.
pgx USE: Get Left margin, assign it to (os) OUT:os
pgy USE: Get Top margin, assign it to (os) OUT:os
pgw USE: Get PrintableArea's Width, assign it to (os) OUT:os
pgh USE: Get PrintableArea's Height, assign it to (os) OUT:os
pgt USE: Get Total Line/Page, assign it to (os) IN:fns=Font Code OUT:os
pgp USE: Get Default Printer's Name. OUT:os
pgr USE: Get Default Printer's Resolution in dots per inch. OUT:os
pgs USE: Get Default Printer's PaperSource. OUT:os
pgz USE: Get Default Printer's PaperSize. OUT:os
pgP USE: Get a list of all installed printers. OUT:OS[]
pgR USE: Get a list of all resolutions available for the printer. OUT:OS[]
pgS USE: Get a list of all PaperSources available for the printer. OUT:OS[]
pgZ USE: Get a list of all PaperSizes available for the printer. OUT:OS[]
Changing setup values:
----------------------
psc USE: Set "Color"-"B/W" setup. IN:ib=flag, ib=true means "in color"
psl USE: Set "Landscape" flag IN:ib=true means "use Landscape"
psf USE: Set "Print to File" option. IN:ib=true means "Print to file"
psn USE: Set Number of Copies. IN:o=number of copies wanted.
pst USE: Set Collate option. IN:ib=true means "Collate output"
psr USE: Set Page range. IN:(j,k)=(From,To) page numbers
psp USE: Set Printer Name. IN:os=Printer Name
psd USE: Set Document Name. IN:os=Document Name
psm USE: Set Margins (in inches) IN:j,k,i,o=left, right, top, bottom
psP USE: Set def Printer call gm("pgP") first. IN:i=index of OS[] where desired printer name is
psR USE: Set Resolution. Call gm("pgR") first. IN:i=index of OS[] where desired resolution is.
psS USE: Set Resolution. Call gm("pgS") first. IN:i=index of OS[] where desired PaperSource is.
psZ USE: Set Resolution. Call gm("pgZ") first. IN:i=index of OS[] where desired PaperSize is.
psg USE: Use Show Page Setup dialog to allow user selection.
psi USE: Use Show Print Information dialog to allow user selection.
Print:
------
prb USE: Print the present Bitmap object (bip)
IN : jf,kf=Location of (bip)'s center relative to paper's center
lf,of(optional)=size to scale to.
Default:full size, putting into consideration the resolutions of (bip) in pixels/inch
and the printer resolution in dots/inch.
REMARK: jf,kf,lf,of are in (1/100)th of an inch units.
prt USE: Print contents of Text Array OS[]
IN:OS[]=Text Array, oi=Number of text rows, fns=Font code
prf USE: Print a Text File.
IN: fls=Text File Name fns=font code
Close:
------
c USE: Close printing operation.
____________________________________________________________________________
gm()
(of class pcs3)
===============
CONTAINING CLASS: pcs3
USE: 2D,3D Graphics
COMMON OUTPUT: (i,j,k) based GUV's, o, of, od, ob, ad, cs are reset.
REMARK: You may use either cartesian or polar coordinates for defining
all locations. All measurments are relative to center.
X values go up as objects move to the right. Y values go up as
objects move up. Angles are positive when rotations are in the
anti-clockwise direction.
Cartesian: (jd,kd) = x,y values of object's center relative to Graphical
Output Decice's center.
Polar: jd = radius kd = angle between radius and the x-axis in
degrees (0:360) kb = coordinate system flag. kb=true means "polar".
MODES:
GENERAL:
--------
CTP USE: Convert Cartesian coordinates of one point to Polar.
IN : jd,kd= X,Y
OUT: od,ad=Radius, Angle.
CTC USE: Convert Polar coordinates of one point to Cartesian.
IN : jd,kd= Radius, Angle.
OUT: oxd,oyd= X,Y
O: USE: Get references to all related objects. This includes (clp), (clo)
which correspond to current values of (cls)
Here is a list of the public objects which you get:
---------------------------------------------------
clp,clo:1st,2nd color present objects
gmo:present Geometry object gpp:Present Path object
spp,sbp:Pen & brush present objects lgp:LinearGradientBrush
tbp:TextureBrush present object rgp:Radial GradientBrush
bip:Present BitmapSource object imp:Present ImageSource object
igp:Present Image vbp:Present VisualBrush
GRAPHICAL SETUPS:
-----------------
sps: USE: Create solid paint pen and brush objects.
IN : cls=Single color code. id=Pen/Brush width, default=1
OUT: Solid Pen and Brush created, refrenced to by spp & sbp
spl: USE: Create Linear Gradient paint brush object.
IN : cls=two color's code.
ad=Angle in degrees at which gradient runs accross shape
OUT: Linear Gradient Brush created, refrenced to by lgp
spr: USE: Create Radial Gradient paint brush object.
IN : cls=two color's code.
OUT: Radial Gradient Brush created, refrenced to by rgp
spt: USE: Create Texture paint brush object using (bip) graphics.
IN : bip=Present BitmapSource object.
OUT: Texture Brush created, refrenced to by tbp
sdi: USE: Set the Image Control whose keyname is supplied as the Graphical output device.
Requires mode "fdi" to finish and execute drawing operation. Can draw 2D,3D,
Images and Video
IN : cs=Image Control's keyname.
REMARK: When you set an image control as the Graphical Output Device, the control
automatically becomes a recepient of MouseDown events which you can handle at
method update() using the condition (cs=="md0") You receive the mouse position
x,y components assigned to (oxd,oyd) If the mouse button clicked was the
right button, you receive (ob=true) additionally.
sdv: USE: Set the Viewport3D Control whose keyname is supplied as the Graphical output device.
Requires mode "fdv" to finish and execute drawing operation. Can draw 3D objects
only.
IN : cs=Viewport3D Control's keyname.
REMARK: When you set a Viewport3D control as the Graphical Output Device, the control
automatically becomes a recepient of MouseDown events which you can handle at
method update() using the condition (cs=="md0") You receive the mouse position
x,y coordinates assigned to (oxd,oyd) If the mouse button clicked was the
right button, you receive (ob=true) additionally.
sdg: USE: Set the graphics Path whose keyname is supplied as the Graphical output device.
Requires mode "fdg" to finish and execute drawing operation. Can draw 2D objects
only.
IN : cs=graphics Path Control's keyname.
sdb: USE: Set the present VisualBrush (vbp) as the Graphical output device.
Requires mode "fdb" to finish and execute drawing operation. Can draw either
(2D,images and video) or (3D) You can repeat loading brush then painting object
with it in order to draw all types of drawings.
ss: USE: Set the Stroke. Defines how lines terminate, how line joints
look like and the type of lines. Needs to be set before creating a Pen.
IN: string (sts) containing 3 char's as follows (default: sts="rrs"):
First char is the "End Cap Style Code" which can be:
b=butt s=square r=round
Second char is the "Join Style Code" which can be:
b=bevel m=miter r=round
Third char is the "Line Type Code" which can be:
s=solid d=dashed t=dotted b=both, dashed & dotted
sq: USE: Set graphics Quality. Defines how to perform each of the
following 4 operations: Not ready yet.
stu: USE: Set unit's Affine Transform.
IN : jd,kd=Original location of object to be transformed
id,od=New location relative to original location (not relative to center)
jf,kf=Horizontal, vertical scale factors
lf,of=Horizontal, vertical shear factors
ad=Rotation angle in degrees. Rotation is around object's center.
Operations Finish:
------------------
fdi: USE: Does necessary operations to finish the process of drawing into an Image Control
which is currently the Graphical Output Device. By default, 3D drawings come on
top of 2D drawings. You can change that by supplying (jb=true)
IN : cs: (Necessary only if you are drawing 3D Assemblies) Keyname of drawn assembly
or mother assembly if more than one have been drawn.
jb: If (jb=true) 2D drawings (Including images and video) will be drawn on top.
fdb: USE: Does necessary operations to finish the process of drawing into a VisualBrush.
which is currently the Graphical Output Device.
fdv: USE: Does necessary operations to finish the process of drawing into the Viewport3D
Control which is currently the Graphical Output Device.
IN : cs: (Necessary only if you are drawing 3D Assemblies) Keyname of drawn assembly
or mother assembly if more than one have been drawn.
Creating new 2D objects:
------------------------
You may (create, create and draw or create and fill) an object on the standard XY 2D plane or
on one of the three 3D planes. If you supply keyname for the object (example: cs="g20"),
resulting (gmo) object will be stored into archives.
General parameters for creating all objects (unless specified):
IN: cns=Containing plane & distance from origin. Planes Can be "","xy","xz" or "yz" meaning
"2D plane","3D, xy plane", "3D, xz plane" or "3D, yz plane" respectively.
Example: xy100 means in a plane which is parallel to the xy-plane at a distance of
(z=100)
(jd,kd) = Center location relative to Graphical Out. Device's center.
(id,od) = Object's width and height.
(lf,of) = Shear factors (if desired)
ad = Rotation angle (if desired)
REMARK: Adding 'd' to the end of the mode string means "draw object".
Addind 'f', means "draw and fill object".
OUT: gmo = Present Geometry object reference.
ca: USE: Create new Arc object.
IN: cns,jd,kd,id,od as expected and (jf,kf) = (Start angle, Arch angle)
cl: USE: Create new Line object.
IN: cns, (jd,kd)=start point coordinates (id,od)=end point coordinates
cr: USE: Create new Rectangle object.
IN: cns, jd,kd,id,od.
crv: USE: Obtain the vertex data of a rectangle in a 3D plane.
IN : Same as "cr".
OUT: PXD[],PYD[],PZD[]=Point arrays. IX[]=Index array. TXD[],TYD[]=Texture coord's
ce: USE: Create new Ellipse object.
IN: cns, jd,kd,id,od.
ct: USE: Create new Text object.
IN: cns, (jd,kd) , fns = Font code.
cp: USE: Create new Graphics Path object.
IN: cns, JD[], KD[]=X,Y coordinates for all points relative to Path's center.
j,k=Coordinates of Path's center relative to Graphical Output Device's center.
OB[]: If OB[n]=true, Points specified in rows (n-1), (n) should be connected with
an arch; else should be connected with a line.
JF[n],KF[n]=x,y radii of ellipse which can contain the arch connecting (n-1),(n)
K[n]: If (=1), means AntiClockwise sweep else Clockwise.
oi=Number of points used to define shape. For closed figure, oi= no. of sides
or points +1.
c=: USE: Create Equal sided object.
IN: cns, (jd,kd) = Coordinates of containing circle's center
od = Containing circle's diameter.
id = Number of sides. id=0: create enclosing circle, id=1 or 2 means Draw a line.
jb : If (jb=true), point coordinates will be supplied. into JD[],KD[] This is
necessary only when this method is called internally while Cylinders and
pyramids are being created.
ci: USE: Get Image from file and draw it.
IN: cns, fls=Image file name, jd,kd,id,od. If (id=0 or od=0) scale will be 1:1.
Creating PC# 3D objects:
------------------------
cR: USE: Create a Rectangular Block.
IN : (id,od,dd)=(Width, Height, Depth), ib: (ib=true) means show hidden lines.
cls=dual color code. first one for visible lines and second one for invisible ones.
cRd: USE: Create and draw a Rectangular Block.
IN : Same as mode "CR".
cRv: USE: Create the vertex data of a Rectangular Block.
IN : (id,od,dd)=(Width, Height, Depth)
OUT: PXD[],PYD[],PZD[]=Point arrays. IX[]=Index array.
cC: USE: Create a Cylinder.
IN : id=No. of base sides, od=Diameter of base's containing circle, dd=Height
js=base plane. Can be "xy", "xz" or "yz".
cCv: USE: Create the vertex data of a Cylinder without drawing.
IN : Same as "cC".
OUT: PXD[],PYD[],PZD[]=Point arrays. IX[]=Index array.
cP: USE: Create a Pyramid.
IN : id=No. of base sides, od=Diameter of base's containing circle, dd=Height
js=base plane. Can be "xy", "xz" or "yz". -ve (dd) means base is fully visible
cPv: USE: Create the vertex data of a Pyramid without drawing.
IN : Same as "cP".
OUT: PXD[],PYD[],PZD[]=Point arrays. IX[]=Index array.
Working on 3D Assembly Files:
-----------------------------
See method gm() of class (pcs) for the following modes (Not including mode "3rd"):
3rc USE: Read 3D Assembly's constants from its file.
3wc USE: Create a new 3D Assembly file and write these constants into it.
3cc USE: Create 3D Assembly file for a cylinder.
3LF USE: Load Assembly file's data into an A3D.
3AF USE: Modify A3D data in order to flatten an area on the assembly's surface and optionally
to add thickness to the flat area positively or negatively.
3AS USE: Modify A3D data by adding half a sphere to it.
3AE USE: Modify A3D data by adding half an Ellipsoid to it.
3AM USE: Modify A3D data by adding a sub-assembly which you specify its specs vertically and
3RS USE: Modify A3D data by replacing an area with a section of a sphere.
3RE USE: Modify A3D data by replacing an area with a section of an ellipsoid.
3RM USE: Modify A3D data by replacing an area with a sub-assembly which you specify its
specs vertically and horizontally in the two method GetX() and GetRadius()
3RQ USE: Modify A3D data by replacing an area of main assembly with a figure which is defined
by its vertical and horizontal cross sections with 2-char code in (os)
3RA USE: Replace a section of main-assembly with a section of sub-assembly.
3SF USE: Save A3D data into file.
3rd USE: Read 3D Assembly file and draw its content using WPF.
IN : cs=3D Assembly keyname. fls=3D Assembly file name.
(jd,kd,ld)= Position of object's center relative to graphical output device's center
cls=Dual Color code.
ks=Paint brush type. Can be (s/l/r/t/v) meaning (Solid/Linear/Radial/Texture/Visual)
js=Material type code. Can be (d/e/s) meaning (Diffuse/Emissive/Specular) def="d"
(lf,of)=Wanted Width and Height of image to be drawn on Assembly's surface.
kf=Vertical position of image relative to assembly's center.
REMARK: If you like to draw from an A3D instead of a file, make the assignment (fls="@n")
where (n) is the A3D number.
Operations which can be done on (gmo):
--------------------------------------
COMMON INPUT: cns= Containing plane. Can be "","xy","xz" or "yz" meaning "2D plane",
"3D, xy plane", "3D, xz plane" or "3D, yz plane" respectively.
jd,kd= Object's center relative to Graphical output device's center.
COMMON INPUT / OUTPUT: gmo = Present Geometry object
REMARK: If a keyname was specified when object was created, and you have supplied the keyname
when making this call (Example: cs="g20"), (gmo) for the object will be retrieved from
archives before any operation is done. If you don't supply a keyname, operations will
be done on (gmo) of last created object.
g USE: Obtain (gmo) and do no operation. IN:cs=2D object's keyname.
grd USE: Render-draw (gmo) as is to present graphical output device.
grf USE: Render-fill (gmo) as is to present graphical output device.
gt USE: Apply present Unit Affine Transform to (gmo) Use gm("stu") to set the transform.
IN: utp: Present "Unit's Affine Transform" object.
gtd USE: Do the same as in mode "gt" then draw the resulting 2D object'
IN: Present "Unit's Affine Transform" must be set in advance.
gtf USE: Do the same as in mode "gt" then draw-fill the resulting 2D object.
IN: Present "Unit's Affine Transform" must be set in advance.
grs USE: Render-fill 2D object using 3D Special effects
IN: ks=Special Effect type. ks="r": Reflection ks="d": Depth.
For (Reflection) only: cls=Single Color code.
of=Brightness factor (1:5) default:2.5
For (Depth) only: cls="Brightest-Darkest" double color code
id=Depth in Pixels, ad=3D angle. ib: ib=true means apply scaling effect.
OPERATING ON THE PRESENT BitmapSource OBJECT (bip):
---------------------------------------------------
Creating new (bip):
-------------------
blf USE: Load Image file and create (bip) from the resulting image object.
IN: fls: Image file name
lf,of=Wanted size. lf=of=0 means full scale
Saving 2D drawing into file:
----------------------------
COMMON IN: fls=File name.
ks="i","b" or "v" meaning save 2D drawing which has been drawn on on Image control,
v brush or Viewport3D control.
bsb USE: Save (bip) into "bmp" file.
bsg USE: Save (bip) into "gif" file.
bsj USE: Save (bip) into "jpeg" file.
bsp USE: Save (bip) into "png" file.
bst USE: Save (bip) into "tiff" file.
bsw USE: Save (bip) into "wmf" file.
___________________________________________________________________________________________
hm()
========
CONTAINING CLASS: pcsu
USE: Using pointers in C# and Interfacing with Windows unmanaged code
COMMON OUTPUT: (i,j,k) based GUV's reset.
Copying the buffer pointed to by (op) to C# type variables:
-----------------------------------------------------------
REMARK: This mode automatically frees the memory allocated to (op) at its end.
ts USE: Copy buffer at (op) to type string.
IN : op OUT:os
tc USE: Copy character at (op) to type char.
IN : op OUT:oc
tC USE: Copy buffer at (op) to type Character array.
IN : op OUT:OC[]
ty USE: Copy byte at (op) to type byte.
IN : op OUT:oy
tY USE: Copy buffer at (op) to type byte array.
IN : op OUT:OC[]
ti USE: Copy integer at (op) to type int.
IN : op OUT:o
tI USE: Copy buffer at (op) to type int array.
IN : op OUT:O[]
td USE: Copy double at (op) to type double.
IN : op OUT:od
tD USE: Copy buffer at (op) to type double array.
IN : op OUT:OD[]
Loading the buffer pointed to by (op) from C# type variables:
-------------------------------------------------------------
REMARK: This mode automatically allocates memory for the generated buffer at (op)
fs USE: Load buffer at (op) with data copied from type string.
IN: os OUT:op
fc USE: Load character at (op) with data copied from type char.
IN : oc OUT:op
fC USE: Load buffer at (op) with data copied from type character array.
IN : OC[] OUT:op
fy USE: Load byte at (op) with data copied from type byte.
IN : oy OUT:op
fY USE: Load buffer at (op) with data copied from type byte array.
IN : OY[] OUT:op
fi USE: Load integer at (op) with data copied from type int.
IN : o OUT:op
fI USE: Load buffer at (op) with data copied from type int array.
IN : O[] OUT:op
fd USE: Load double at (op) with data copied from type double.
IN : od OUT:op
fD USE: Load buffer at (op) with data copied from type double array.
IN : OD[] OUT:op
Copying/Loading a portion of the buffer pointed to by (op) to/from byte array Y[]:
----------------------------------------------------------------------------------
ta USE: Copy a portion of the buffer at (op) to array Y[]
IN : i=Offset from (op) location, o=number of bytes OUT: Y[]
REMARK: This mode does not alter the memory allocated to (op).
fa USE: Load a portion of the buffer at (op) with bytes in Y[]
IN : i=Offest from (op) location, o=number of bytes, oi=Buffer total
REMARK: This mode does not alter the memory allocated to (op).
Operations done on memory:
--------------------------
ma USE: Allocate memory to buffer pointed to by (op)
IN : i=Requested memory size in bytes. Default: Length of OY[]
mf USE: Free allocated memory to (op)
General I/O:
------------
ro USE: Open a link (Obtain a handle) to resource.
IN : fls: Resource path name,
js: File access code. Could be: "r","w" or "rw" meaning: "Read","Write","Read/Write"
ks: Share access granted to other processes: "","r","w","rw" Default: "".
meaning: "No access","Read","Write" or "Read/Write"
ip: Security attributes. Default: IntPtr.Zero
OUT: dhp : Safe file handle to resource.
rr USE: Receive data from resource.
IN : OY[]: Byte array to receive data.
i : (Optional) Index in OY[] where received data will start at.
o : Number of bytes you like to receive. Must be <= Length of OY[]
OUT: oi: Number of bytes read.
OY[]: Byte array loaded with data.
rw USE: Send data to resource.
IN : OY[]: Byte array loaded with data to be sent.
i : (Optional) Index in OY[] where data starts at.
o : Number of bytes to be written.
OUT: oi: Number of data written.
rc USE: Close handle.
Error handling:
---------------
uer USE: You need to call this method immediately after accessing an unmanaged code function.
OUT: eri=Error numeric code, ers=Error message.
uem USE: This mode translates a numeric error code into text message.
IN : eri=Numeric error code. OUT: ers=Text message.
Obtaining device lists:
-----------------------
dcl USE: Get device class GUID lists from registry. OUT: OS[]
drl USE: Get USB device registry list. OUT: OS[]
dpl USE: Get a list of path names of HID devices. OUT: OS[], oi=No. of items
IN : ib=false: devices currently connected only ib=true: all devices.
Operations which apply to general USB devices:
----------------------------------------------
GUID SELECTION: In modes where GUID is required, (ks) is assigned a code as follows:
ks="": Use the GUID in (gup), ks="js": Use GUID supplyed in (js) as a string
ks="r":use raw usb GUID, ks="h":use HID GUID, ks="b":use hub GUID,
ks="c":use host controller GUID
dr USE: Register this class to receive device change events.
IN : ks=Class GUID selection code. See "GUID Selection" above.
k= Code number of the Struct which we are interested in receiving. Can be:
0:OEM, 2:Volume, 3:port, 5:Interface, 6:Handle. Default: 5
dvp USE: Get vendor parameters (VID,PID,MI,COL) from a device path name.
IN : os=Dev Path name OUT:O[]=The 4 parameters in order.
Operations which apply to devices that use HID driver:
------------------------------------------------------
dil USE: Get device information set (or list)
IN : ks=Class GUID selection code. See "GUID Selection" above.
ib : ib=false:List includes currently connected device only. ib=true: All devices.
OUT: op=deviceInfoSet pointer, gup=GUID used.
REM: When you are finished with the list, call hm("mf") to free allocated memory.
di USE: Get pointer to one device interface data struct in list.
IN : i=struct index in list, gup,op=Values obtained in mode "dil".
OUT: dip=device interface data struct.
dp USE: Get Device Path.
IN : op,dip=Values obtained in modes "dil" and "di".
OUT: os=Device Path.
ds USE: Search deviceInfoSet for a device with vendor parameters known.
IN : j=VID:Vendor ID, k=PID:Product ID, jy=MI:Manufacturer Interface number,
ky=COL:Collection number.
OUT: OS[]=matching HID device name path(s) found, oi=No. of matching path's,
o= row number in list of first match.
dcp USE: Get The HID device's capabilities struct instance.
IN : dhp= Device handle.
OUT: op = Pointer to full data buffer, cap: Capabilities struct instance.
Operations which apply to devices that use WinUSB driver:
---------------------------------------------------------
whp USE: Get WinUSB handle.
IN : fls=Device path name, (js, ks, ip): See mode "ro"
OUT: dhp=Device handle (of type SafeFileHandle), whp=WinUSB handle (Of type IntPtr)
wdp USE: Get device descriptor.
IN : whp: WinUSB handle, Obtained in mode "whp".
OUT: wdp: Descriptor struct instance.
wr USE: Read device data using bulk or interrupt transfer.
IN : OY[]=Empty Buffer, oc=Transfer type. Can be 'b' or 'i' meaning "bulk" or "interrupt"
ou=Number of bytes expected.
OUT: OY[]=Loaded buffer, ou=Number of bytes transfered.
ww USE: Write data to device using bulk or interrupt transfer.
IN : OY[]=Buffer loaded with data, oc=Transfer type. Can be 'b' or 'i'.
OUT: ou=Number of bytes transfered.
wtc USE: Do Control transfer (Read or Write)
IN : oc='r' or 'w' meaning "Read" or "Write", i=request #, j=Packet index, k=Packet value
OY[]=DataStage sent or Recieved.
OUT: ou=bytes transfered, OY[]=Loaded Buffer (if oc='r')
wc USE: Close handle.
___________________________________________________________________________________________
nm()
========
CONTAINING CLASS: pcs (All modes) and pasp (Servers not included)
USE: Networking
COMMON OUTPUT: (i,j,k) based GUV's reset.
MODES:
HTTP Protocol:
--------------
r: USE: Resolves an IP Address. It converts address in (urs) from string format
to numeric format and vice versa.
IN/OUT:urs, OS[] (Case of resolving string format to numeric one only)
REMARK: Since one address in string format can resolve to more than one numeric
address. OS[] is also returned in this case containing all numeric addresses
found. The (urs) returned in this case contains the same address in OS[0]
hg: USE: Sends query / receives data using HTTP protocol, method "GET".
REMARK: (1) You may add a query string to (urs). To do so, add "?" at
its end followed with "var1=data1&var2=data2&..."
(2) jb,kb are used to allow/disallow the option of eliminating
html and other tags around data in order to make data more
visible.
IN: urs=URL including query if necessary.
ib = Expected data type indicator. ib=false: text ib=true: binary
jb = true: Replace each pair of brackets (< >) & all enclosed
char's with one '|'
kb = true: Replace each pair of braces ({ }) & all enclosed
char's with one '|'
OUT: os (if text), OY[] (if binary)
FTP Protocol:
-------------
COMMON INPUT: urs: FTP address which starts with "ftp://" and ends with the
file or directory which you like to operate on.
Example: urs="ftp://ftp.microsoft.com/developr/Readme.txt"
ids: Your User ID.
pss: Your Password.
fls: Name of the source local file in case you are uploading or
name of the destination local file in case you are
downloading.
COMMON OUTPUT: os: FTP status which shows operation success or failure.
fmd: USE: Makes (Creates) a new directory at a remote FTP server.
fdd: USE: Deletes (Removes) a directory at a remote FTP server.
fdf: USE: Deletes (Removes) a file at a remote FTP server.
fgf: USE: Gets (Downloads) a file from remote FTP server.
fpf: USE: Puts (Uploads) a file to a remote FTP server.
E-Mailing:
----------
ms: USE: Send an e-mail message.
IN : uhs=SMTP (Outgoing) Mail Server address
ids,pss=User ID and password. If server does not authenticate
outgoing mail, make ids=pss="".
js=Sender e-mail address ks=Recipient e-mail address
os=Message Subject OS[]=Message Body
kb=Content flag. kb=true means HTML. Default: Plain text
ib=Attachment flag. ib=true means attach file (in fls)
fls=Name of attachment file (only if ib=true)
mc: USE: Check for new messages.
IN : uhs,ids,pss = POP(Incoming) Mail Server,User ID and password.
OUT: os=List of new messages.
mr: USE: Retrieve one e-mail message.
IN : uhs,ids,pss = POP(Incoming) Mail Server,User ID and password.
i=Number of the message to be retrieved (Starts with 1)
OUT: os=The wanted message.
md: USE: Delete one e-mail message.
IN : uhs,ids,pss = POP(Incoming) Mail Server,User ID and password.
i=Number of the message to be deleted.
Low Level TCPIP Communication:
------------------------------
REMARK: When method reads data, it returns it in both string (in os) and binary (in OY[]) formats
The string returned is UTF8 encoded. When it writes data, it checks (os) If (os="@"),
it sends the binary data in OY[]. otherwise it sends the string (os)
to: USE: Open a new connection with server.
IN : uhs=Host name upi=Port number
tr: USE: Read server's response.
OUT: os,OY[]=Received data o=Number of bytes received.
tw: USE: Write (send) a message to server.
IN : os=Message to be sent. os="@" means write binary data in OY[] instead.
tc: USE: Close Connection with server.
Low Level HTTP Communication, Client:
------------------------------------
hsc: USE: Set cache policy
IN : ks=Cache requirements. ks can be = cf/df/nc/co/ns
"cf" means "Get it from cache. If unavailable, get fresh copy".
"df" means "Use default". Same as "cf" + putting cache age into consideration.
"nc" means Don't get it from cache.
"co" means Cache is the only allowed source.
"ns" means Don't store into cache or use cache.
ho: USE: Open a new connection with server.
IN : urs=URL including requested file.
ks=Cache requirements for this request only.
ks can be = cf/df/nc/co/ns (see mode "hsc")
hw: USE: Write (send) request to the server.
hwp: USE: Write (send) request to the server together with POST data.
IN : os=Post data. If you are not using method "POST", use mode "hw".
hr: USE: Read server's response.
OUT: os=Received data
hc: USE: Close Connection with server.
TCP Servers:
------------
REMARK: Mode "tsm" requires the file "TLogic.dll" to be available into your working directory.
Mode "hsm" requires the file "HLogic.dll" to be available into your working directory.
You can use mode "lc" to create the minimum code version of either file. Recreating
Personal C Sharp tools (by running pcs) generates both files.
tss: USE: Start the TCP single-thread server. See examples on "Networking". Server will run
by itself except that it will be calling a method which you prepare in advance to
know how to reply to callers and get other instructions.
IN : urs=Server's IP Address to listen to in "dotted numeric form"
default: If you supply (urs="") all available addresses will be listened to.
upi=Port to listen at. i=No. of the m?(int t) method which contains logic code.
k=Receive Timeout in milliseconds.
tsm: USE: Start the TCP multi-thread server. See examples on "Networking". Server will run
by itself except that it will be calling a method in class "TLogic" which you
prepare in advance to know how to reply to callers and get other instructions.
IN : urs=Server's IP Address to listen to in "dotted numeric form"
default: If you supply (urs="") all available addresses will be listened to.
upi=Port to listen at. k=Receive Timeout in milliseconds.
jf,kf: Min number of Worker Threads and completion Port Threads respectively.
Default (1,1)
lf,of: Max number of Worker Threads and completion Port Threads respectively.
Default (25,1000)
REMARK: Server calls method ServerLogic(string os, int counter, RxTx rt) of class TLogic
at each status change or data receiption. For status change, it assigns to (os):
"*l", "*c", "*s" or "*e" meaning "Listening", "Connected", "Stopped" or "Ended
with Error". For data receiption it assigns the data to (os)
The connection counter is updated by the server and sent with each call.
A reference to the current instance of the internal class RxTx is also sent.
The method returns a string which contains either instruction to the server or
a reply message. Instructions can be "#d", "#s" or "#n" meaning "Disconnect
client", "Stop listening" or "Don't send reply". The reply returned can either
be text or binary. If binary, "@" is returned which means send the binary array
OY[] of class RxTx instead. The method accesses this array through the object
ref var it receives. See networking examples for more details.
hsm: USE: Start the HTTP multi-thread server.
IN : URS[]: Loaded with all the prefixes which you like to serve. Port number must be
included unless you are using port 80.
jf,kf: Min number of Worker Threads and completion Port Threads respectively.
Default (1,1)
lf,of: Max number of Worker Threads and completion Port Threads respectively.
Default (25,1000)
REMARK: Server calls method ServerLogic(string os, int counter, HRxTx rt) of class HLogic
after it receives a new request. (os) contains URL requested alone or followed
with "|", followed with post data if call was to submit a form.
The method returns a string made of 2-char status code + "|" + 2-char content
type code + "|" + file path. See networking examples for more details.
lc: USE: Create the minimum code version of either file "TLogic.dll" or "HLogic.dll".
IN : ib="Which file" flag, ib=false:TLogic.dll ib=true:HLogic.dll
O: USE: Get references to all related objects (See Pc# Reference)
Here is a list of the public objects you get:
---------------------------------------------
tcp: present TcpClient object nsp: present NetworkStream object
tsp: present TcpListener object hlp: present HttpListener object
rqp: present WebRequest object rsp: present HttpWebResponse object
stp: General use Stream object
_____________________________________________________________________________
om()
=========
CONTAINING CLASS: pcs and pasp.
USE: Operations done on (os)
COMMON INPUT: ls = mode
COMMON OUTPUT:
MODES:
Converting the string in (os) to other types:
---------------------------------------------
ti: USE: Convert Integer number in (os) to int.
IN: os OUT: o
th: USE: Convert Integer number in (os) to hex code.
If number was not integer, fractions will be neglected.
IN/OUT: os
tf: USE: Convert number in (os) to float.
IN: os OUT: of
td: USE: Convert number in (os) to double.
IN: os OUT: od
tb: USE: Convert boolean value in (os) to boolean.
IN: os OUT: ob
tr: USE: Convert number in (os) to short.
IN: os OUT: or
tl: USE: Convert number in (os) to long.
IN: os OUT: ol
to: USE: Convert number in (os) to object.
IN: os OUT: oo
ty: USE: Convert number in (os) to byte.
IN: os OUT: oy
tg: USE: Convert the 128 bits embedded into (os) to a GUID object.
IN: os OUT: gup=Present GUID object
ta: USE: Convert concatenated txt lines + \n's in (os) to array.
IN: os OUT: OS[]=Text Lines, oi=number of lines
tY: USE: Convert string in (os) to Byte Array using encoding specified in (oc).
IN: os, oc=Encoding, can be a/u/c/b meaning ASCII/UTF8/Unicode/Base64String.
OUT: OY[]
tq: USE: Convert query string in (os) to keys and values in KS[],OS[]
IN : os
OUT: KS[],OS[], oi=number of key-value pairs
Converting from other types to (os):
------------------------------------
fi: USE: Make int number in (os) from int (o) (Converts (o) to (os)).
IN: o OUT: os
fh: USE: Convert hex code in (os) to int assigned also to (os)
IN/OUT: os
ff: USE: Make number in (os) from float (of)
IN : of=Float Number
ib=true means format number so that it contains a number of decimal digits = i
i = Wanted number of decimal digits. Default:2
OUT: os
fd: USE: Make number in (os) from double (od) .
IN : od=Double Number
ib=true means format number so that it contains a number of decimal digits = i
i = Wanted number of decimal digits. Default:2
OUT: os
REM: Will also clean (os) by removing excessive zeros or nines at its fraction part.
Example: "2.25000001" and "2.24999999" will be changed to "2.25".
fb: USE: Make value in (os) from boolean value (ob)
IN : ob OUT: os
fr: USE: Make number in (os) from short (or)
IN : or OUT: os
fl: USE: Make number in (os) from long (ol)
IN : ol OUT: os
fo: USE: Make string in (os) from object (oo)
IN : oo OUT: os
fy: USE: Make number in (os) from byte (oy)
IN : oy OUT: os
fg: USE: Make (os) from GUID object (gup). Embeds all the 128 bits into (os)
IN : gup=GUID object OUT: os
fgc: USE: Create a new GUID object first, then convert to (os) as in mode "fg".
OUT: os
fa: USE: Make composite string in (os) from string array OS[]
IN : OS[], jb=true:Keep leading spaces OUT: os
fY: USE: Make string in (os) from Byte Array OY[] using encoding specified in (oc)
IN : OY[], oc=Encoding, can be a/u/c/b meaning ASCII/UTF8/Unicode/Base64String.
OUT: os
fq: USE: Make query string (os) from keys and values in KS[],OS[]
IN : KS[], OS[]
OUT: os
Other operations performed on (os) or OS[]:
-------------------------------------------
c: USE: Cleans (os) It removes all non-text characters then trims (os) at
both sides. You may use (jb) and/or (kb) to eleminate part(s) of
this operation as described below.
IN: os, jb="keep leading spaces" flag. If (true) will keep leading
spaces if (false) will trim (os) on both sides.
kb="keep non-text characters" flag. If (true) will trim (os) only
without removing non-text characters.
OUT: os , i,j,k based GUV's cleared.
m: USE: Inserts string (js) into (os) at character number (j)
IN: os, js, j OUT: os
r: USE: Replaces sub-string (js) of (os) with string (ks)
IN: os, js, ks OUT: os
s: USE: Puts each of the sub-strings of (os) which are seperated with a
special character (oc) into a seperate row of array OS[].
Sub-strings are cleaned and trimmed unless you specify (kb=true).
IN: os=Composite string, oc=seperation character
kb=sub-string cleanup flag. If (true) substrings will be kept as are.
without removing non-text characters or (leading & trailing) spaces.
ib=Double Quotes flag. If (ib=true), and (oc) was found in a sub-string
which is enclosed in double quotes, it will be treated as part of the
sub-string, not a data seperator. Also, the sub-string will be placed
into OS[] without the double quotes.
OUT: OS[]=sub-strings, each in a seperate row, oi=number of sub-strings
u: USE: Convert characters of (os) to upper-case IN/OUT: os
l: USE: Convert characters of (os) to lower-case IN/OUT: os
hta: USE: Convert Hashtable's key's & values to arrays
IN: HTP=Present Hashtable object OUT: KS[]=Keys OS[]=values
hfa: USE: Make Hashtable from key's & value arrays
IN: KS[]=Keys OS[]=values OUT: HTP=Present Hashtable object
O: USE: Get references to all related objects (See Pc# Reference)
Here is a list of the public objects you get:
---------------------------------------------
gup: present Guid object HTP=present HashTable object
_____________________________________________________________________________
sm()
=========
CONTAINING CLASS: pcs (All modes) and pasp (Not all modes)
USE: System handling
COMMON INPUT: ls = mode
COMMON OUTPUT: (i,j,k) based GUV's reset.
MODES:
ge: USE: Get the value of an environment variable. IN:js=var name OUT:os
gE: USE: Get all environment names(keys) & values.OUT:KS[]=Keys OS[]=val's
gv: USE: Get C# Version. OUT:os
gp: USE: Get Personal C Sharp Version. OUT:os
go: USE: Get Operating System Version. OUT:os
gd: USE: Get Usr Domain Name. OUT:os
gc: USE: Get Computer Name. OUT:os
gu: USE: Get User Name. OUT:os
gs: USE: Get Stack Trace. OUT:os
gl: USE: Get Logical Drives. OUT:OS[]
Date & Time:
------------
REMARK: All the data you are getting can be for current date and time or
for any date and time you choose.
If you want them for current date and time, supply os="".
If you want them for a specific date, supply os="mm/dd/yyyy".
If you want them for a specific date and time supply
js="hh:mm:ss" in addition to (os)
If you want them for the date and time object which has been created before this
call, supply (ib=true;)
If you like to add "months, days, and/or years to the object, supply ks="mm/dd/yy"
If you like to add "hours, minutes, and/or seconds to the object, supply ks="hh:mm:ss"
Supplied numbers in (ks) can be +ve or -ve and can be made of any number of digits.
If you like to replace addition with subtraction (reverse all signs), add kb=true.
Common Output: dtp=Present DateTime object reference.
dd: USE: Get date as mm/dd/yyyy IN:os (See Remark) OUT:os
dt: USE: Get time as hh:mm AM/PM IN:os (See Remark) OUT:os
dw: USE: Get Weekday as Monday IN:os (See Remark) OUT:os
dm: USE: Get Month name as January IN:os (See Remark) OUT:os
dl: USE: Get long format of date IN:os (See Remark) OUT:os
Long format as: Monday, January 02, 2006
Creating and Controling System Processes:
-----------------------------------------
pn: USE: Start a new process to run an extrnal program.
IN : os=external program name followed with all parameters exactly
as done from command mode.
js=Directory path where external program is. js="" means current directory.
OUT: os=Text output of the external program.
Accessing Event Log:
-------------------
lw: USE: Write a message to System's Event Log.
IN : js=Event log name, ks=Source name, os=Message to be logged in.
oc=Event type. Can be (e/w/i/s/f) meaning (Error, Warning, Information,
SuccessAudit, FailureAudit) Default is (oc='i')
OUT: After executing this mode the Event log should contain the new entry.
Accessing System Registry:
--------------------------
rw: USE: Write new value(s) for a key. If key does not exist, will be created.
IN : js=Application Name, ks=Key Name, (o/ol/os/OS[]/OB[]) = Value(s)
oc=Type Code. Can be: s/e/m/d/b/q Meaning: String, ExpandString,
MultiString, Dword, Binary, Qword.
Value(s) required by each (in order) are: os, os, OS[], o, OB[], ol.
ib=RootKey indicator. ib=true means: Store data under HKEY_USERS otherwise
data will be stored under HKEY_CURRENT_USER RootKey
OUT: After executing this mode, either of the two registry keys:
HKEY_CURRENT_USER \ pcs \ Application Name \ Key Name
HKEY_USERS \ pcs \ Application Name [depending on (ib)]
will have the new value(s) supplied. If it does not exist, will be created.
rr: USE: Read value(s) of the key supplied.
IN : js=Application Name, ks=Key Name., ib=RootKey indicator
OUT: o/ol/os/OS[]/OB[] depending on value type. See mode "rw" for details.
rd: USE: Delete a key and its associated value.
IN : js=Application Name, ks=Key Name. ib=RootKey indicator
rda: USE: Delete all keys associated with this Application.
IN : js=Application Name. ib=RootKey indicator
OUT: os=Text output of the external program.
Accessing System Clipboard: (available in class pcs only)
---------------------------
cc: USE: Clear Clipboard
cgt: USE: Get plain text from Clipboard. OUT: os=Text, ob=true means not found
cgr: USE: Get RTF text from Clipboard. OUT: os=Text, ob=true means not found
cgu: USE: Get Unicode text from Clipboard. OUT: os=Text, ob=true means not found
cgh: USE: Get HTML text from Clipboard. OUT: os=Text, ob=true means not found
cgi: USE: Get Image from Clipboard. OUT: imp=Image object ref, ob=true means not found
cst: USE: Set plain text into Clipboard. IN: os=Text
csr: USE: Set RTF text into Clipboard. IN: os=Text
csu: USE: Set Unicode text into Clipboard. IN: os=Text
csh: USE: Set HTML text into Clipboard. IN: os=Text
csi: USE: Set Image into Clipboard. IN: imp=Image object's ref.
Shortcuts:
----------
sc : USE: Create a shortcut for a file on the desktop.
IN : fls=Complete Path of target file (Starting by the drive) os=Name of Shortcut.
scp: USE: Create a shortcut for a file on "Programs" menu. This is the menu which you get
when you click the [Start] button then select [Programs]. Some people call it the
"Start" menu. It's actually in a subfolder of the Start menu folder.
In Windows 10, you get this menu by clicking the "Windows" icon at bottom left corner.
IN : fls=Complete Path of target file. os=Name of Shortcut.
Assemblies:
----------
akn: USE: Generates new Keypair and stores the pair into file "KeyPair.pr". Also stores the
public key alone into file "PublicKey.pk". You may rename files thereafter but not
extensions since they are necessary for identifying the keys.
as : USE: Create (set) an assembly. If assembly should duplicate external directory
(not current one), Names in ks,js,KS[],JS[] must be full pathnames. additionallly,
supply the external directory path in (ds)
IN : fls : Assembly file name. Extension can be "exe" or "dll".
ds : Source directory if not current one
LS[]: AssemblyName data: LS[0]=Name(Optional) LS[1]=Version LS[2]=Culture,
LS[3]=Company LS[4]=CopyrightInfo LS[5]=KeyFile
ks : Name of the class with entry point (for executable assemblies only)
KS[]: All classes which should be included into the assembly except the one in (ks)
JS[]: All resource files to be embedded into assembly.
js : Paths of external files which contain refrenced objects within assembly
seperated with commas.
kb : Window application flag. kb=true means windows executable (clickable) file.
ib : "Compile without additives" flag. ib=true: No main() or using directives are
to be added to any class within assembly.
asf: USE: Fully sign an assembly which has been delay-signed.
IN : fls=Assembly file name. ks=KeyPair file name (extension:pr)
avn: USE: Instructs the CLR not to verify identity of an assembly which has been delay-signed
IN : fls=Assembly file name.
avy: USE: Instructs CLR to return back to verifying identity since assembly is now full-signed
IN : fls=Assembly file name.
aGi: USE: Install assembly into GAC (Global Assembly Cache) To Uninstall it use the command:
gacutil /u AssemblyName at the Console. AssemblyName includes no extension.
IN : fls=Assembly file name.
aGl: USE: List all assemblies currently in the GAC.
OUT: os=list
agn: USE: Get Assembly's simple name which is normally the original file name without exten.
IN : fls=Assembly file name.
OUT: os=Simple name.
agN: USE: Get all assembly name components.
IN : fls=Assembly file name.
OUT: OS[0]=Simple name, OS[1]=Version, OS[2]=Culture, OS[3]=Company
OS[4]=Copyright, OS[5]=Public key, OS[6]=Key Token
agr: USE: Get Resource. It can get it in the form of stream object opened to the reource,
a byte array containing all resource or it can save resource into disk. The path
will be a duplicate of original path relative to the current folder or
relative to (ds) if you have assigned the path of a destination folder to it.
IN : fls=Assembly file name. fls="" means Get resource in calling assembly.
ds = Destination directory. ds="" means save output file relative to current folder.
js=Resource file name only (not full path)
ks=Output selection, can be ("","@" or "f") meaning (return stp,OY[] or file res.)
OUT: stp=Stream object pointing to res. OY[]=resource as binary data data
ob=Success flag. ob=true means error encountered.
agR: USE: Get list of all Resources.
IN : fls=Assembly file name. fls="" means get resource list of calling assembly.
OUT: OS[]=list, ob=Success flag. ob=true means error encountered.
e: USE: Exit to Command mode. IN: i=Optional exit code number
O: USE: Get references to all related objects (See Pc# Reference)
Here is a list of the public objects you get:
---------------------------------------------
dtp: present DateTime object
_____________________________________________________________________________
tm()
=========
CONTAINING CLASS: pcs (all modes) and pasp (modes "d,dl, s" & modes starting with "E" only)
USE: Text handling
COMMON INPUT: ls = mode
COMMON OUTPUT:
REMARKS: (1) This method sends its output to the default text output
device (toa) Also, at mode "i" it receives its input from the
default text input device (tia). Device assignments of (tia & toa)
can be set or changed using method dm() at modes "to" and "ti"
respectvely.
(2) The default mode for this method is "dl". So tm(); is the same
as tm("dl");
MODES:
i: If (tia="t") or (tia="f"):
--------------------------
USE: Display the value contained into (os) to user, then get the line
of text user enters into (os) also and jump to the block number
requested in (bli). See remarks
IN: os = String to display to user. bli = block number to jump to.
OUT: os = Line of text entered by user.
REMARKS: Always follow tm("i") with (return;)
If (tia="s"):
-------------
Everything is done in same manner except that there will
be no jump to a new block and you need not to follow tm("i") with a
(return;)
d: USE: Display the value contained into (os) and keep cursor on same line
IN: os = String to display. See remarks.
dl: USE: Display the value contained into (os) then move cursor to next line
IN: os = Line of text to display. See remark (2).
dg: USE: Display a picture on the text screen (Applies to text screen only)
IN: ims=Image file path.
df: USE: Flush display to allow all displayed text to show up. This is necessary before doing
a lengthy operation following text display. This mode applies to text screen display
only.
c: USE: Clear screen (Applies to both text screen and Console)
g: USE: Get text (Applies to text screen only)
OUT: OS[]=Text lines oi=Number of lines
Editing Text in Text Screen:
----------------------------
es: USE: Select a portion of the text.
IN : j,k=Orders of the start and last characters to be selected
esa: USE: Select All Text
ec: USE: Copy. Copy Selected text to the Clipboard. Keep the text unchanged.
et: USE: Cut. Copy selected text to clipboard. Erase text after being pasted.
ep: USE: Paste. Display item stored into Clipboard at cursor.
el: USE: Return order of the character where cursor is or where selected text starts.
OUT: o=character order.
egt: USE: Get Selected text as plain text OUT:os
egr: USE: Get Selected text as RTF OUT:os
ert: USE: Replace Selected text as plain text with (os) IN :os
err: USE: Replace Selected text as RTF with (os) IN :os
REMARK: If no text was selected in modes "ert", "err", text in (os) will be
inserted at cursor.
Inserting Formfeed codes into RTF files:
----------------------------------------
If you like to force the printing of a RTF file (like the ones created with tm("fsr")
or with Wordpad) to move to new pages at your choice, insert the code << p>> (See
REMARK below) within the RTF text where you want the printer to move to a new page,
save the modified file then call tm("FF") to replace your codes with actual formfeed
characters before printing the file.
FF: USE: Replace << p>> with actual formfeed codes IN:fls=RTF File name
REMARK:
The space before the "p" in the code << p>> shown in this section has been
intentionally added in order to force your browser to display it without trying to
execute it as an html tag. You must eliminate the space when you insert the code
into your actual file.
Filing Text Screen Content:
---------------------------
flt: USE: Load plain text file into text screen IN:fls=File name
flu: USE: Load unicode plain text file into text screen IN:fls=File name
flr: USE: Load rich text file into text screen IN:fls=File name
fst: USE: Save text screen to a plain text file IN:fls=File name
fsu: USE: Save text screen to a unicode plain text file IN:fls=File name
fsr: USE: Save text screen to a Rich Text File (RTF) IN:fls=File name
p: USE: Print text screen contents using (fns) Notice that you can also save the
file to a Rich Text File and print it using Wordpad.
IN : fns=Font code
vg: USE: Hide "text screen" to give visibility to graphics.
vt: USE: Return visibility to "text screen".
O: USE: Get text screen objects.
OUT: rta,tfa,mma,lba,pna = References to text screen control objects
b: USE: Make the speaker beep in order to draw attention.
IN : j=Frequency (37:32767), k=Duration in Milliseconds
s: USE: Access string (txs) search & browsing
IN: txs=String to be searched
js=String to skip ks=String to stop reading immediately before
j=Number of (js)'s to skip. If (js="" & ks="") it means number of
char's to skip.
OUT: os=String starting after last (js) and ending before start of (ks)
REMARKS: (1) After each search operation, the section of (txs) starting
at char zero and ending immediately before (ks) is removed
(2) If ks="": os="" and the section of (txs) which will be
removed starts at char zero and ends by the last char of
the last js.
(3) If js="", os=String starting at char zero and ending
before the start of (ks)
(4) If (js="" & ks=""), os="". The first (j) chars of (txs)
will be eliminated only.
wd: USE: Display an HTML document on the WebScreen. IN: os=HTML Document.
wu: USE: Display the web page whose URL is supplied. IN: urs=Pag's URL
Encryption:
-----------
REMARKS: (1) Encryption and decryption modes expect data to be supplied either into the
string (os) or into the byte array OY[]. If supplied into OY[], make os="@" or ="".
(2) Encryption and decryption modes return data into both (os) and OY[].
(3) When (os) is assigned encrypted data, it's a base 64 string.
(4) In asymmetrical algorithm, ks=Container's name where keys are. If you like to
use keys which are stored into a XML file, make the assignments
ks="*f" and fls="The file name". If you like to use the "XML format string"
which you get from method tm("Eak"), make the assignment ks="*s". Notice that
if either the file or the string contains only public key data, you can use them
when you encrypt (mode "Eae") but you can't use them when you decrypt.
Epe USE: Encrypt data using password based encryption.
IN : Data to encrypt in (os) or OY[] (See Remarks (1:3))
OUT: Encrypted data in both (os) and OY[].
Epd USE: Decrypt data which was encrypted with password-based encryption.
IN : (os) or OY[]=Encrypted data. (See Remark (1:3))
OUT: Decrypted data in both (os) and OY[].
Epp USE: Generate a random password.
IN : j=Password length, k=Number of Non-alphanumeric char's
OUT: os=Password.
Eh USE: Encrypt string supplied using hashing method.
IN : Data to encrypt in (os) or OY[] (See Remark (1))
js=Algorithm. Can be: MD5, SHA1, SHA256 or SHA512.
OUT: Hash code in both (os) and OY[]. REMARK: (os) is a base 64 string.
Esk USE: Obtain random key and initialization vector for Rijndael symmetric encryption.
OUT: JY[]=Key, KY[]=IV
Ese USE: Encrypt data using Rijndael symmetric encryption.
IN : Data to encrypt in (os) or OY[] (See Remark (1:3))
JY[]=Key, KY[]=IV
OUT: Encrypted data in both (os) and OY[].
Esd USE: Decrypt data using Rijndael symmetric encryption.
IN : (os) or OY[]=Encrypted data. (See Remark (1:3))
JY[]=Key, KY[]=IV
OUT: Decrypted data in both (os) and OY[].
Eaf USE: Generate new key-pair for asymmetric encryption and storing it into xml file.
IN : fls=File name with the "xml" extension.
ib: if (ib=false), Only public key will be stored into file.
Eak USE: If the container name supplied is new, a new key-pair will be generated and
stored into the container. If (kb=true) received, container will be deleted.
IN : ks=Container name, kb=Delete flag, ib=Return both keys into (os)
OUT: os=Public Key in XML format if (ib=false) or both keys if (ib=true)
Eae USE: Encrypt using RSA assymetric algorithm.
IN : (os) or OY[]=data to encrypt. (See Remark (1:4))
ks=Container name. See REMARK number (4)
jb=EOAP flag, jb=true:use EOAP padding.
OUT: Encrypted data in both (os) and OY[].
Ead USE: Decrypt data using RSA assymetric algorithm.
IN : (os) or OY[]=Encrypted data. (See Remark (1:4))
ks=Container name. See REMARK number (4)
OUT: Decrypted data in both (os) and OY[].
Eas USE: Digitally sign data.
IN : (os) or OY[]=Data. (See Remark (1:4))
ks=Container name. See REMARK number (4)
js=Hashing algorithm. Can be "MD5" or "SHA1".
OUT: Signature in both (os) and OY[].
Eav USE: Verify digital signature.
IN : (os) or OY[]=Data. (See Remark (1:4))
ks=Container name. See REMARK number (4)
js=Hashing algorithm. Can be "MD5" or "SHA1".
IY=Signature.
OUT: ob=Validation flag. ob=true means Valid.
Eac USE: Clear RSA provider object.
_________________________________________________________________________________________
um()
=========
CONTAINING CLASS: pcs and pasp.
USE: Utilities
COMMON INPUT: ls = mode
COMMON OUTPUT:
MODES:
b: USE: Jump to a new block.
IN: bli = requested block number.
REMARK: Always follow um("b") with (return;)
c : USE: Clear i, j and k based GUV's.
co: USE: Clear contents of all (o) based variable.
C : USE: Clear i, j and k based GU Arrays.
CO: USE: Clear contents of all (o) based Arrays.
R : USE: Rank array OD[]'s rows based on the data they contain.
IN : OD[]=Array whose rows are to be ranked, oi=active no of rows in OD[]
ib=Ranking order ib=false means ascending order ib=true means descending order.
OUT: O[] containing ranks of OD[] rows. Array OD[] will not be altered
EXAMPLE: If OD={5.1,3.3,1.7,2.2} & ib=false, will return: O[]={2,3,1,0}
s: USE: Sleep.
IN: i = time in milliseconds.
t USE: Timer (upto 1 minute) Returns the time in millisecond intervals which has passed
since last call when (ib) was true.
IN : ib="New reference" flag. ib=true means create new reference. So future times returned
will be made relative to this time.
OUT: o=Time difference in milliseconds.
g: USE: Force garbage collection.
O: USE: Check to see if an object is null.
IN : ks=Name of any public object (see PC# Reference)
OUt: ob=null state flag. ob=true means object is null.
Mathematical operations:
------------------------
ma: USE: Mathematically calculate abs(number)
IN: od OUT: od
mc: USE: Mathematically calculate ceil(number)
IN: od OUT: od
mf: USE: Mathematically calculate floor(number)
IN: od OUT: od
ml: USE: Mathematically calculate log(number)
IN: od OUT: od
mn: USE: Mathematically calculate the minimum of 2 numbers.
IN: od , jd OUT: od
mp: USE: Mathematically calculate (od) to the power (jd)
IN: od , jd OUT: od
mr: USE: Mathematically generate a random number in the range (0 : i)
IN: i=max value OUT: o
ms: USE: Mathematically calculate Square Root(number)
IN: od OUT: od
mt: USE: Mathematically calculate Trigonometric functions.
IN: od=Number to apply function to, js = function or constant name, could be:
"sin", "cos", "tan", "asin", "acos", "atan" or "pi"
OUT: od
mta: USE: Mathematically calculate (asin, acos or atan) with quadrant adjustment.
IN: od=function value, js = function (asin/acos/atan), ib=true means (X is -ve) in case
of (asin and atan) or (Y is -ve) in case of (acos)
OUT: od=Angle in degrees (0:360), adjusted for the quadrant.
mh: USE: Mathematically calculate Hyperbolic functions.
IN: od=Number to apply function to, js = function or constant name, could be:
"sinh", "cosh", "tanh" or "e"
OUT: od
mx: USE: Mathematically calculate the maximum of 2 numbers.
IN: od , jd OUT: od
mlc: USE: Apply law of cosines to calculate length of one side of a triangle using lengths
of the other two and the angle between them. If you make the assignment (ib=true)
it will return the angle between the two sides if you supply the 3rd side's length.
IN : jd,kd = Lengths of other two sides. ad=Angle between them.
or: ib=true, jd,kd = Lengths of the two sides, id = 3rd side's length
OUT: od = Length wanted or ad = Angle wanted (if ib=true)
mq2: USE: Find the real roots (if any) of the second degree equation: a*x^2 + b*x + c = 0
IN : jd=Constant (a), kd=Constant (b), id=Constant (c)
OUT: OD[] Containing all real roots found. oi=Number of real roots found.
mq3: USE: Find the real roots of the third degree equation: a*x^3 + b*x^2 + c*x + d = 0
IN : jd=Constant (a), kd=Constant (b), id=Constant (c), od=Constant (d)
OUT: OD[] Containing all real roots found. oi=Number of real roots found.
Form Documents:
---------------
fl: USE: Create field locations file. IN: fls=Form's Image file path.
ft: USE: Create Data File template. IN: fls=Form's Image file path, k=Key Length.
fa: USE: Analyse file columns. IN: fls=Form's Image file path.
fd: USE: Enter data into Form. IN: fls=Form's Image file path.
fp: USE: Print Form with data for one key.
IN : fls=Form's Image file path, kys=Identification Key
jf,kf=Location of form's center relative to paper's center.
lf,of=Desired width and height of printed Form
REMARK: jf,kf,lf,of are all in 1/100th of an inch unit.
Playing Audio-Wave files:
-------------------------
Loading and playing files are done asynchronously by default. If you like to do the operation
synchronously set (ib)
awo: USE: Open a new Audio-wave file play operation.
awl: USE: Load ".wav" file. IN: ib=sync flag. ib=true:load synchronously.
awp: USE: Play file once or continuously.
IN : ib: sync flag. See above. kb=Continuous play flag. kb=true:play repeatedly
aws: USE: Stop Play.
awc: USE: Close Audio Play operation.
_____________________________________________________________________________
vm()
====
CONTAINING CLASS: pcs3
USE: 3D Graphics and Video
COMMON OUTPUT: (i,j,k) based GUV's, o, of, od, ob, ad, ld, dd, cs are reset.
MODES
GENERAL:
--------
O: USE: Get references to all related objects. If you supply a keyname for a valid object
you'll get the object which corresponds to that keyname. Otherwise, you'll get the
last created object of each kind.
Here is a list of the public objects which you get:
---------------------------------------------------
clp,clo:1st,2nd color present objects
igp = Image control which is currently the Graphical output device.
vbp = Visual Brush which is currently the Graphical output device.
vpp = Present Viewport3D object.
gmp = Present GeometryModel3D object.
gmo = Present 2D Geometry object.
pcp = Present PerspectiveCamera
ocp = Present OrthographicCamera
mcp = Present MatrixCamera
alp = Present AmbientLight
dlp = Present DirectionalLight
plp = Present PointLight
spp,sbp:Pen & brush present objects lgp:LinearGradientBrush
tbp:TextureBrush present object rgp:Radial GradientBrush
srp:Present Storyboard object mvp:Present ModelVisual3D object
IN : cs=Keyname. Here is a list of the first two char's of a keyname and the object
which you expect to get:
al: alp dl: dlp pl: plp pc: pcp oc: ocp
mc: mcp g2: gmo g3: gmp mv: mvp
Registering WPF objects:
------------------------
Most WPF objects can be assigned a name and stored into archives. If you supply a keyname
(assigned to cs) when you create any object, the object will automatically be registered into
both PC# and WPF archives. If later, you wanted to rerigister the object after being modified
under the same name or you want to register an object which has not been registered before,
assign wanted keyname to (cs), make sure the object is currently available and call vm("r")
r USE: Register presently available object into both PC# and WPF archives using the keyname
assigned to (cs) If object has been already registered, it will be overwritten.
IN : cs=Keyname.
SETUPS:
-------
scp: USE: Set Perspective or Orthographic Camera's position.
IN : jd,kd,ld=Position Coordinates.
scl: USE: Set Perspective or Orthographic Camera's Look direction.
IN : jd,kd,ld=Vector components.
scv: USE: Set Perspective camera's Field Of View. Will do nothing if camera was different.
IN : id= Field Of View Angle.
scw: USE: Set Orthographic camera's Width. Will do nothing if installed camera was different.
IN : id= Width.
slc: USE: Set Light Color.
IN : cs=Keyname, cls=color code.
slp: USE: Set Point Light Position.
IN : cs=Keyname, jd,kd,ld= Position Coordinates.
sld: USE: Set Directional Light direction.
IN : cs=Keyname, jd,kd,ld=Vector components.
sm: USE: Set Material and color brush of a level 1 3D object or one unit cylinder of a
level II 3D Assembly (Must have keyname)
IN : cs = Object keyname (Optional)
js = Material code. Can be (d/e/s) meaning (Difuse/Emissive/Specular) Default:"d".
ks = Brush type. Can be (s/l/r/t/v) meaning (Solid/Linear/Radial/Texture/Visual)
Default="s".
cls= Dual Color code. First one sets back material background color and second one
sets front material background color.
sv: USE: Set Vertex data. Overwrites positions data with data in arrays PXD,PYD,PZD. If
object was identified to be a unit cylinder inside an assembly (by analyzing its
keyname), PYD[] will be neglected.
IN : cs = Object keyname (Optional)
PXD[],PYD[],PZD[] = Position data arrays.
jd,kd,ld = Center coordinates relative to Graphical Output Device's center.
st: USE: Set 3D Transform.
IN : js=Scale factors seperated with commas.
ks=Rotation axis vector components seperated with commas.
os=x, y and z displacement components seperated with commas.
ad=Rotation angle in degrees.
Creating WPF 3D objects:
------------------------
You may (create or create and fill) an object. However you need to supply the vertex data
of the object before the call, which are:
PXD[],PYD[],PZD[] Arrays of type "double" which contain the x ,y & z coordinates of each point
of the 3D object.
NXD[],NYD[],NZD[] Arrays of type "double" which contain the Vector3D components of the Normal
property of each point.
IX[] An array of type "int" which contains the indices of the points of all triangles which
make the shape in counter-clockwise order.
TXD[],TYD[] Arrays of type "double" which contain Texture X & Y Coordinates.
Additionally, you need to supply the background color of the front and back material of the
object and the material type code.
If you supply keyname for the object (example: cs="g30"), resulting (gmp) object will be
stored into archives and can be retrieved with same keyname.
REMARK: If you're creating a Rectangular Block, a cylinder or a Pyramid, you don't have to
supply the above mentioned arrays. Method gm() at modes "cRv", "cCv" and "cPv" can
supply the required arrays for each of the 3 objects in order.
co: USE: Create new WPF 3D object.
IN: Vertex data arrays (see above), cs=Keyname (optional) See above.
cls=Dual color code. Second code is the background color of front material and
first code is the background color of the back material.
js=Material type code. Can be (d/e/s) meaning (Diffuse/Emissive/Specular) def=d
ks=Brush type. Can be (s/l/r/t/v) meaning (Solid/Linear/Radial/Texture/Visual) def=s
(jd,kd,ld)=Wanted position of object's center relative to Graph Out Device's center.
OUT: gmp=Present GeometryModel3D object.
cof: USE: Create new WPF 3D object and draw it with filling.
IN/OUT: Same as mode "co".
Creating Camera:
----------------
If you supply keyname for the object (example: cs="pc0"), resulting object will be
stored into archives and can be retrieved with same keyname.
ccp: USE: Create Perspective Camera.
IN : os : Camera position. Contains (x,y,z) coordinates seperated with commas.
js : Look Direction. x,y,z components of vector seperated with commas.
ks : Up Direction. x,y,z components of vector seperated with commas.
id : Field of View angle.
cs : Keyname. Example: cs="pc0". Optional. See above.
cco USE: Create Orthographic Camera.
IN : os : Camera position. Contains (x,y,z) coordinates seperated with commas.
js : Look Direction. x,y,z components of vector seperated with commas.
ks : Up Direction. x,y,z components of vector seperated with commas.
id : Camera Width.
cs : Keyname. Example: cs="oc0". Optional. See above.
ccm USE: Create Matrix Camera. You create it, make (mcp) its ref before calling.
IN : mcp: Camera's object ref.
cs : Keyname. Example: cs="mc0". Optional. See above.
Creating Lights:
----------------
If you supply keyname for the object (example: cs="dl0"), resulting object will be
stored into archives and can be retrived with same keyname.
cla: USE: Create Ambient Light.
IN : cs : Keyname. Example: cs="al0". See above.
cls: Light color code.
cld: USE: Create Directional Light.
IN : cs : Keyname. Example: cs="dl0". See above.
cls: Light color code.
jd,kd,ld: x,y and z components of Light vector.
clp: USE: Create Point Light.
IN : cs : Keyname. Example: cs="pl0". See above.
cls: Light color code.
jd,kd,ld: x,y and z coordinates of Light position.
Operations which can be done on (gmp):
--------------------------------------
REMARKS: These operations require the GeometryModel3D object (gmp) for the 3D object which you
like to operate on to be available. This can be done in one of 3 means:
(1) You may supply keyname of the 3D object, so it can be retrieved from archives and
(gmp) made its reference before operation is done. This could be possible only if
you have supplied the same keyname to method vm("co") when the object was created.
(2) User may click on the object, then you receive the event and obtain gmp by calling
vm("gh") before any other operation is done.
(3) Otherwise, the last accessed (gmp) will be the one to operate on.
g USE: Retrieve a 3D object from archives and make (gmp) its reference without doing any
operation.
IN : cs=Object's Keyname.
OUT: gmp (Present GeometryModel3D object)
gh USE: Make (gmp) the reference of the hit (mouse clicked) object.
IN : oxd,oyd (You receive them at method update() when an object is clicked on) See Remark
OUT: gmp, os=keyname.
REMARK: When you set an image control as the Graphical Output Device, the control
automatically becomes a recepient of MouseDown events which you can handle at
method update() using the condition (cs=="md0") You receive the mouse position
x,y components assigned to (oxd,oyd)
grf USE: Render-fill (gmp) as is to present graphical output device.
IN : cs=Keyname (Optional) See above
gt USE: Apply present 3D Transform to (gmp) You need to set transform with vm("st") first.
IN : cs=Keyname (Optional) See above.
jd,kd,ld = Current center coordinates.
REMARK: Our 3D transforms add-up. If you like to erase old transforms before applying
a new one, you must call mode "gtn" first.
gtn USE: Clear object's transform. Return transformed object to "No Transform" condition.
IN : cs=Keyname (See above)
gtf USE: Do the same as in mode "gt" then draw-fill the resulting 3D object.
IN : cs=Keyname (Optional) See above
Animation:
----------
REMARKS:[a] To animate an object, it must have a valid keyname. This means that you should supply
a keyname when creating an animateable object.
[b] You may animate a 2D Geometry (gmo), 3D Geometry (gmp) or a 3D visual (mvp)
[c] If you like to animate a 3D object when user clicks it, you can always get its
keyname by calling vm("gh") or vm(vh") before calling this mode.
COMMON IN : cs=Keyname.
O[]=Times in seconds since start
OS[]=Object positions which are required to be reached at each time specified in O[]
Each row of OS[] should contain one number except for mode "arx" (Rotation
animation) where it should contain 4 numbers seperated with commas. The 4
numbers are the 3 components of the axis vector and the angle in degrees.
o : Delay time in seconds to start animation after.
jb: (jb=true) means Stop "Auto reverse" feature.
j : (j=0) which is the default means repeat forever. Else, animation cycle will
be repeated a number of times which is equal to the value assigned to (j)
i : Begin time in animation time unit. Default: zero. See mode "atu".
jd,kd,ld = Original center coordinates. necessary for scaling and rotation when
object is not centered at origin.
apx USE: Animate x-position using supplied formula.
apy USE: Animate y-position using supplied formula.
apz USE: (For 3D objects only) Animate z-position using supplied formula.
asx USE: Animate x-Scale factor using supplied formula.
asy USE: Animate y-Scale factor using supplied formula.
asz USE: (For 3D objects only) Animate z-Scale factor using supplied formula.
ara USE: Animate rotation angle alone using supplied formula. Assign rot axis vectors to (ks)
IN : ks=Rotation axis vector components seperated with commas.
arx USE: Animate rotation axis & angle using supplied formula. Rotation axis vectors and
angles are specified together into OS[] .
at USE: Trigger animation. If you supply no parameters, animation applied to all objects
which are contained into original (mvp) will start. If you supply keyname of one
3D object, animation applied to that object alone will start. If you supply keyname
of mother assembly, animation applied to all objects will start. If you like
animation to start when an event takes place, call this mode at the event handling
block of method update()
IN : cs=Keyname of 3D object or 3D assembly (optional)
atu USE: Set Animation Time Unit in seconds (default:1)
IN : id=Time in seconds
Slow Movement of 3D objects:
----------------------------
REMARKS:[a] To move an object, it must have a valid keyname. This means that you should supply
a keyname when creating a movable object using vm("co") or vm("cof")
[b] This operation requires object (gmp) for the 3D object which you like to move.
It can come from 2 sources:
(1) You may supply keyname of the 3D object, so (gmp) can be retrieved from archives.
(2) User may click on the object, then you receive the event and obtain both (gmp) and
keyname by calling vm("gh") Keyname comes assigned to (os)
[c] Timing is measured in animation time unit which defaults to 1 second if not set. See
mode "atu" to know how to set it.
gm USE: Slowly Move or scale a 3D object as per parameters supplied.
IN : i=Begin time (in animation time units) Default:zero meaning "start immediately".
o=Duration (in animation time units) Default:1. See mode "atu" to set the time unit.
js=Scale factors seperated with commas.
ks=Rotation axis vector components seperated with commas.
os=x, y and z displacement components seperated with commas.
ad=Rotation angle in degrees.
cs=3D Object Keyname.
jd,kd,ld = Present center coordinates. Necessary for scaling and rotation when
object is not centered at origin.
gmf USE: Same as "gm" and additionally it draws object.
gmb USE: Move back. Restore original state of an object which has been set to move.
Operations which can be done on ModelVisual3D object (mvp):
-----------------------------------------------------------
COMMON IN: cs=Keyname (Starts with "mv")
v USE: Retrieve a ModelVisual3D object from archives only.
IN : cs=Keyname.
OUT: vmp (Present ModelVisual3D object) becomes its reference.
vc USE: Create a new ModelVisual3D object and make (mvp) ite reference.
IN : cs=Keyname
vh USE: Make (mvp) the reference of the hit (mouse clicked) ModelVisual3D object.
IN : oxd,oyd (You receive them at method update() when an object is clicked on)
OUT: mvp, os=keyname.
va USE: Add one (child) ModelVisual3D object to the present ModelVisual3D object
IN : cs=Keyname of Present object ks=Keyname of Child object
vt USE: Apply present 3D transform to (mvp)
IN : cs=Keyname
vtn USE: Reset present 3D transform on (mvp)
IN : cs=Keyname
vm USE: Apply Slow Motion to (mvp)
IN : js=Scale factors seperated with commas.
ks=Rotation axis vector components seperated with commas.
os=x, y and z displacement components seperated with commas.
ad=Rotation angle in degrees.
cs=ModelVisual3D object's Keyname.
i=Begin time (in animation time units) Default:zero meaning "start immediately".
o=Duration (in animation time units) Default:1. See mode "atu" to set the time unit.
vmb USE: Move back. Restore original state of an object which has been set to move.
Level II 3D Drawing:
--------------------
COMMON IN: cs : Keyname of the assembly which will contain the created figure.
cls: Combination color code for back-front material.
id : Number of sector divisions.
ks : Starting-Y, Ending-Y, Center Point-Y seperated with commas.
js : (Optional) Material type code. Default (js="d")
od : Enclosing circle diameter of base.
If you like to display a drawing on assembly's surface, prepare a
visual brush with the drawing and add the following parameters:
lf,of : Desired width and height of drawing on the 3D surface.
kf : Vertical position of drawing center relative to surface.
REMARK: If you don't specify a vlaue for (kf), image will be cetered on the surface.
If you don't specify values for (lf,of), image drawing will not happen.
If you like to save 3D Assembly's data into file, add the following parameters:
fls : Table file name.
oc : Make the assignment (oc='f') to indicate that you want the assembly to be saved.
If you like to archive all unit cylinders assigning keynames consisting of "a0" + 2-digits in
the range (00:99) to them automatically, add the parameter:
ib=true;
Remarks: (1) Keyname "a0000" will be assigned to the unit cylinder at assembly's bottom.
(2) If you don't opt to archive unit cylinders when creating a 3D assembly, top and
bottom unit cylinders will be the only ones archived. Their keynames will be "at"
and "ab" respectively followed with the same number as of assembly's keyname (cs)
vcp: USE: Create Paraboloid. IN: jd=Parabola's constant. 2D Eq: x^2=jd*y
vce: USE: Create Ellipsoid. IN: (jd,kd)=(Horiz,vert) radii. 2D Eq: x^2/jd^2 + y^2/kd^2 = 1
vch: USE: Create Hyperboloid. IN: (jd,kd)=Hyperbol's constants. 2D Eq: x^2/jd^2 - y^2/kd^2 = 1
vcm: USE: Create 3D Assembly using method GetX(double y, double radius) vertically and/or
method GetRadius(double angle, double radius, double y) horizontally.
vcf: USE: Create 3D Assembly using pre-recorded data stored into an assembly data file.
IN : fls=Data file name. cls= Color code (If you like to paint it with a different color)
kf,lf,of: Specify them if you like to paint surface with visual brush (See above)
vc3: USE: Level 3 drawing. Requires same parameters as mode "vcm" except that (ib=true) by
default and Material type is not settable (always of type "diffuse")
vcs: USE: Create Sloped cylinder. Parameters listed as "Common" apply with the following
adjustments:
id=Number of base sides. od=Enclosing circle diameter of cylinder's top.
dd= Cylinder's height. jd=Enclosing circle diameter of cylinder's bottom.
vct: USE: Create twisted cylinder. Parameters listed as "Common" apply with the following
adjustments:
id=Number of base sides. jd=Radius of rotation. ad=Rotation angle in degrees.
Multimedia-Video:
-----------------
mvo USE: Open video play operation. Generates necessary objects.
IN : id,od: Width and Height of rectangle which will contain video.
mvl USE: Load new Video file. IN : fls=Video file.
mvp USE: Play.
mvu USE: Pause.
mvs USE: Stop.
mvv USE: Set Volume. IN: id=volume. Range(0:1)
mvb USE: Set Balance. IN: id=Balance. Range(-1:1)
mvc USE: Close Video Play Operation.
___________________________________________________________________________________________
wm()
======
CONTAINING CLASS: pasp only.
USE: Web handling
COMMON INPUT: ls = mode
COMMON OUTPUT: (i,j,k) based GUV's reset.
MODES:
h: USE: Opens HTML page. It generates necessary HTML tags upto [body]
and sets page title and colors. It also opens the html file
and write all generated tags into it.
IN : fls = Output html file name
os = Page's title.
cls = Page foreground / background combined color code.
ks = HyperLink unvisited / visited combined color code
ims = If you like to display an image as a background for the
page assign its URL to (ims)
o: USE: Opens HTML loading operation. It does a cleanup
job which is necessary to do before starting to load HTML into
the label (cis) of a control.
pn: USE: Get this page's "aspx" file name. OUT:os= File name
pa: USE: Get this page's Application folder's path relative to domain root.
OUT: os=Application path name.
Displaying Text:
----------------
COMMON USE: Displays the text string assigned to (os)
COMMON IN : os = Text to be displayed.
cls = Foreground color (2-char color code)
fns = Font code.
ds = Alignment used to display text (direction). could be :
e = east w = west or c = center.
REMARK: (ds="e"), (ds="w") are effective only at mode "dp".
j = Indention in number of characters.
d or dw:USE: Displays the text string (word) supplied into (os) and keeps
cursor on same line at the end of displayed text.
IN : os,cls,fns,ds,j (See above)
dl: USE: Displays the text string supplied into (os) then moves cursor to
next line.
IN : os,cls,fns,ds,j (See above)
dp: USE: Starts a new paragraph, displays the text string supplied into
(os) then keeps cursor at the end of displayed text.
IN : os,cls,fns,ds,j (See above)
df: USE: Display the content of a local "txt" or "html" file.
IN : fls=File path relative to web application folder
du: USE: Display the content of an external web page or text file.
IN : urs=URL of the web page. Example: "http://www.microsoft.com"
db: USE: Create and Display a label control.
IN : cs=Keyname to identify the control with.
os=Label's text. cls=(foreground-background) color code. To make
background transparent, you must Use 6-char code like: (cls="r09y00";)
fns=Font code. i=width in pixels o=Height in pixels.
ib=Positioning flag. ib=true means requesting absolute positioning
jd=Border width in pixels. The default of (jd=0) means no border.
di: USE: Create and Display an image control.
IN : cs=Keyname to identify the control with.
ims=URL of the image. os=Alternative text (optional)
i,o=Image size in pixels j,k=Empty space to leave around image
ds="n/s/e/w/c" Sets how text around is aligned relative to image
ib=Positioning flag. ib=true means requesting absolute positioning
jd=Border width in pixels. The default of (jd=0) means no border.
l: USE: Start "Leave text as is" mode. Allows displaying text as is until
the mode is closed by hm(lc) In this mode leading and trailing
spaces and also line feeds are left unchanged. However you may
still specify text color, font and direction in this mode.
lc: USE: Closes "Leave text as is" mode.
Creating Hypertext:
-------------------
a: USE: Generates the "anchor" tag which allows user to link to a
different page file at a different (URL) by clicking on a phrase
within the HTML document.
IN : urs = URL address of destination file or an e-mail address to send
message to. os = Phrase to click on
Creating Tables:
----------------
to: USE: Opens a table. It generates the opening tag and specifies options
IN : i = Number in pixels which specifies both the border width and
cell padding. (i=0) means table with no borders.
o = The percentage amount of table's width relative to page width
cls: Default color code for the table.
fns: Default font code for the table.
th: USE: Generates one table header row.
IN : OS[] = Header. Titles of all columns in sequence.
I[], O[] = Column and row span. Number of columns and rows which
each column data occupies. Default is (1).
LS[] = Direction. How each column text is aligned inside its
containing cell.
JS[] = Font used for displaying each column text.
KS[] = Foreground color code (2-char code) for each column
td: USE: Generates one table data row.
IN : OS[] = Data. The text content of all columns in one row.
I[], O[], LS[], JS[], KS[] = Same as in mode "th".
tc: USE: Generates closing table tag.
Installing Controls:
--------------------
i: USE: Install one control. Called from method setup() to install control
IN : cs=Control's keyname cis: Control's label
cns=Control's table or panel container.
CIS[]=Item names for multi-item controls like "Choices".
cus=Default return value.
j,k=Coordinates of control's starting grid within its table container.
i,o=Column span (horizontally and vertically) Which means the
number of grids a control covers in both directions. Default:1
jf,kf=Length in (chars,lines) for tf's and ta's.
lf,of=(Width,Height) in pixels for a Control.
od=Maximum Length in (chars) for tf's and ta's only.
jd=Border width in pixels.
kd=CellSpacing for Tables, GridView and Calendar.
ds=Direction or alignment code. Can be (n,s,e,w,c.ne,nw,se,sw)
Meaning (North,South,East,West,Center,Northeast,Northwest,
Southeast,Southwest) It shows where a control and its label
should be placed inside their containing grids.
cls=Foreground-Background combined color code.
fns=Font Code
cts=tooltip text (appears when placing mouse curser at control)
vlb=Validation bool (vlb=true means "field required" validation requested)
vls=Validation string for Range and Compare validation or RegularExpression string
vlc=Validation char. Indicates the type to base validation on.
Can be (i,d,s,D,C) meaning (int,double,string,Date,Currency),
vlc='r'means do Reg Expression validation with vls=Reg Exp string.
ims=bckground Image url. For Images, Hyper links, tables.
urs=URL for Hyper Links. Can also be an e-mail address.
ib=Boolean value. Have different meanings for different controls.
For Text Fields:(ib=true) means password text field.
For Submit and Reset buttons: (ib=true) indicates that you are
replacing the button with a clickable image.
For Radio Buttons: (ib=true) causes the button to be selected.
ob=editability. For tf,ta: ob=true:Read only.
os="Label positioning indicator". Can be (n,s,e,w) meaning set
label (above, below, right of, left of) its control.
kb=AutoPostBack flag. (kb=true) means turn the feature on.
id=Tab index (control scan order when pushing TAB's
starting by 0)
js(for gv only): Contains any number of these chars concatenated:
s/S=Insert/Remove Select bttn d/D=Insert/Remove Delete bttn
e/E=Insert/Remove Edit button
r/R=Allow/Disallow Sorting p/P=Allow/Disallow Paging
h/H=Show/Hide Header f/F=Show/Hide Footer
g/G=Show/Hide Grid seperation lines
COMMANDS[](for gv only): contains any number of SQL commands to
execute and display the resulting data on the GridView.
Additionally you may include (cus), (cui) and/or CUS[] to set
default return values.
ir: USE: Reset all installation parameters. You need to call this mode
before calling mode "i" if you have done an operation which could
have assigned value to any parameter.
Controls' setup:
----------------
REMARK: See "Common Output" for var's which are reset before return.
sC: USE: Set color IN:cls=Foreground-Background compound code
sF: USE: Set font IN:fns=Font code
sB: USE: Set Bounds IN:(lf,of)=(Width,Height),jd=Border width. All in Pixls
ss: USE: Set Size (for tf,ta) IN :(jf,kf)=Number of Visible(chars,lines),
od=Max no. of chars (visible & invisible)
For (tb,ca,gv): kd=Cell Spacing in Pixels
sg: USE: Set background image IN: ims=Image file name or ims="b":use (bip)
st: USE: Set tool tip IN: cts=tooltip text.
sn: USE: Set TAB order IN: id=TAB order for the control. id=-1: Skip it
sl: USE: Set control's label(For lb,bt,cb,rb,hl) IN: cis=Label text.
sL: USE: Set item list for multi-item controls IN:CIS[]=Items.
su: USE: Set update value.
IN : For (tf,ta) cus=String to use as initial value. For (bt,cb,rb)
supply cus="0" or cus="1" to set state to Off or on.
For (ch,Single item ls) supply (cui=index of item to be selected)
For (Multiple item ls) supply CUS[] containing "1" or "0" in its
rows to set the state of the list item each row represents.
For Hyper links(hl) supply (urs=URL to navigate to)
sb: USE: Set bool value IN: ib=value Meaning depends on control type.
for tf's ib=true: means password tf. (char's replaced with "*"'s)
for ls's ib=true: means Multi-selection ListBox.
for cu: eliminate Email field.
se: USE: Set editability IN: ob=value. For tf',ta ob=true: Rd only txt
sE: USE: Enable/Disable a control IN: jb=true: means Disable control.
sx: USE: Set focus.
sp: USE: Set Page Size (for gv only) IN: o=Number of lines per page.
Set page to goto for lo,cu,cp,pr IN: urs=URL to goto.
sc: USE: Set Column data (for gv only)
REMARK: You call this mode once for each column to be displayed.
If You like to display all columns as they are, don't call this
mode. If you call it once, all original columns will be eliminated
unless you call back to set each of them.
IN : js=Original column name ks=Desired col name, ks="" means use (js)
oc=Formatting char for numeric fields. Can be:
C=Currancy F=Fixed [Assign wanted dec digits number to (j)]
ims=URL of Background Image to replace column name with.
cls=Combined Foreground-Background Color code.
sm USE: Attach context menu to the control, IN: cs="mnd0". where d=menu group number
Performing Bitmap operations:
-----------------------------
bo: USE: Open a new bitmap operation for dynamic graphics generation. It
creates the bitmap (bio), sets it as the "Graphical output device"
then Sets the content type to "Image/jpeg" and prepares the
Response object and buffering for image delivery.
IN : (lf,of)=(Width,Height) of desired bitmap object
bc: USE: Close current bitmap operation. It sends object to client's
browser then disposes all generated objects.
Filing:
-------
fp USE: Obtain the local system path for a file. The path comes with slash char's
doubled as required by C#.
IN : js=Path relative to web application folder
OUT: fls=Full system path
Operations done on the Page Object:
-----------------------------------
pn USE: Obtain current page's name. Example:"pg1.aspx". OUT:os
pa USE: Obtain current folder name. Example:"WPDI".
Operations done on the Request and Response Objects:
----------------------------------------------------
rq USE: Read URL's Query string and retrieve all values for one key.
IN : ks=Key (or parameter) Name. OUT: OS[]=All values
rp USE: Read Form POST string and retrieve all values for one key.
IN : ks=Key (or parameter) Name. OUT: OS[]=All values
rw USE: Write a string to the page. String may contain HTML tags.
IN : os=String to write.
rr USE: Redirect to another web page.
IN : urs=URL for the destination page.
Page, Session and Application Variables:
----------------------------------------
vs USE: Set (or store) an application, session or page string variable.
IN : ks=Variable name os=Variable value
ks must end with "_a", "_s" or "_p" to indicate that the variable
type is "application", "session" or "page" respectively.
vg USE: Get (or retrieve) an application, session or page string variable.
IN : ks=Variable name OUT: os=Variable value
ks must end with "_a", "_s" or "_p" to indicate that the variable
type is "application", "session" or "page" respectively.
Operations done on cookies:
---------------------------
Cookies can be simple or complex. For a simple cookie, make the assignment (js="")
For a complex cookie assign cookie's name to (js) The two strings (ks,os) represent
the key and value of a simple cookie or one "key-value" pair in a complex cookie.
The expiration flag (jb) can be (false) meaning "temporary cookie" or (true) meaning
a cookie with an expiration date.
ks USE: Set a cookie. IN: js, ks=key, os=value.
kg USE: Get Cookie value. IN: js, ks=key OUT: os
ke USE: Set expiration date. IN: js, jb=true (see above), ks, dtp=Date object ref
Handling JavaScript operations:
-------------------------------
jf USE: Send a JavaScript file to client. The file will be placed at the top of the page.
IN : fls= Name of file or URL.
js USE: Send a script block.
IN : ks : Event which must take place before code is executed. Can be any valid
JavaScript event or "" meaning do at no condition or "pl" meaning do when
window.onload event is raised.
cs : The keyname of the control where the event is raised. Can also be "" meaning
page when it starts or "pl" meaning page after all its cotents have been loaded.
os : Loaded with the code block.
i : No. of milliseconds to repeat execution after. i=0 means run one time only.
j : Meaningful when (i>0) only. Means stop repeating after (j) repititions.
jar USE: Receive data sent to server via AJAX call.
OUT: os=Data ajb=AJAX call indicator. ajb=true means AJAX data found available.
jas USE: Send text data in (os) to the browser as an AJAX return data.
IN : os=Data to be sent.
Membership:
-----------
mls: USE: Get Login status. If member has logged off, returns ids="" as an indication.
OUT: ids= Logged in member's ID. os="hh:mm:ss": The time passed since user logged in.
mlo: USE: Mark user as logged off.
c: USE: Close HTML page. It generates closing tags for all open tags.
Objects:
--------
O: USE: Returns a reference to the control object whose keyname is
supplied. The name of the reference var returned is the present
object name for the control type. Example: if cs="bt0" was
supplied, (btp) will be made a reference to bt0's object.
IN: cs=control's key name
Present Objects for Controls:
-----------------------------
Button: btp Label: lbp CheckBox: cbp RadioButton:rbp DropDownList:chp
ListBox: lsp TextField: tfp TextArea: tap HyperLink: hlp Panel: pnp
Table: tlp Image: igp Literal: itp Calendar: cap FileUpload: flp
LogIn lop CreateUser:cup PassRecovry:prp
ImageButton:ibp ValidationSummary: vsp
Additional public objects which you get by this mode:
-----------------------------------------------------
cfp:Present Configuration object ssp:Present SessionParameter object
_____________________________________________________________________________
xm()
=========
CONTAINING CLASS: pcs only.
USE: Accessing External Objects.
COMMON INPUT: ls = mode
COMMON OUTPUT: (i,j,k) based GUV's reset.
REMARKS: (1) Any program which contains calls to method x() for the purpose
of accessing external programs must be executed with the "xrun"
tool. To execute a file named "FileName.exe" with the "xrun"
tool, from command mode type: xrun FileName [Enter]
(2) The file x.txt is used internally by this method.
MODES:
Operations done on threads:
---------------------------
tc: USE: Create one thread.
IN : o=Thread number, bli=block to start at.
os=Thread private objects. Should contain all present object ref's which you like
to privatize for the thread seperated with commas. Here is a list of them:
gpp, bip, utp, spp, sbp, lgp, rgp, tbp, dtp, tcp, rqp, rsp, nsp
They represent (in order): GraphicsPath, Bitmap, Matrix, pen, SolidBrush,
LinearGradientBrush, PathGradientBrush, TextureBrush, DateTime, TcpClient,
WebRequest, HttpWebResponse, NetworkStream
t#: USE: Get Current thread number. OUT:o=Thread number
tms: USE: Send message to another thread. If mail box of recipient thread
was not empty, message will not be sent and (dnb=false) will be
returned.
IN : o=Recipient thread number, os=Message OUT:dnb, true means done
tmr: USE: Receive incoming message. If no message is found (dnb=false) will
be returned.
OUT: o=Sender thread number, os=Message, dnb, true means done
tp: USE: Set priority for one thread.
IN : o=Thread number, i= Priority (0:4), 4 means heighst priority.
tw: USE: Wait for a specific amount of milliseconds or until waked up by
another thread (using mode "tu", "tua" or "ti")
IN : i=Time to wait in milliseconds. (i=0) means wait until waked up.
tu: USE: Pulse the thread which has been waiting the longest in a
synchronized block.
tua: USE: Pulse all waiting threads.
ti: USE: Interrupt a waiting or sleeping thread. IN:o=Thread number.
ta: USE: Thread abort. IN:o=Thread number.
ts: USE: Get Thread State. IN:o=Thread number.
OUT: os=Thread State can be="u/r/w/s/a" Where: u=Unstarted r=Running
w=Waiting or sleeping s=Stopped (finished running) a=Aborted
Running external programs:
--------------------------
r: USE: Run an extrnal program.
IN : os=external program name followed with all parameters exactly
as done from command mode.
bli=Block number to go to after external program has been executed.
OUT: os=Text output of the external program.
========================================================================================
**************************
* JAVASCRIPT FUNCTIONS *
**************************
cm()
=========
Function cm() of JavaScript can operate on a limited number of controls which are:
(1) Button (2) Label (3) Checkbox (4) RadioButton
(5) DropDownList (6) List (7) TextField (8) TextArea
(9) Image 10) Table
COMMON OUTPUT: (i,j,k) based GUV's,cs,cls,fns reset
MODES:
HTML Loading:
-------------
o USE: Opens a new HTML loading operation. It does a cleanup
job which is necessary to do before starting to load HTML into
(cis) for a control.
h USE: Add html necessary to (cis) for the display of a string without linefeed.
IN : os = Text to be displayed.
cls = Foreground color (2-char color code)
fns = Font code.
ds = Alignment used to display text (direction). could be :
e = east w = west or c = center.
REMARK: (ds="e"), (ds="w") are effective only at mode "hp".
j = Indention in number of characters.
hl USE: Add html necessary to (cis) for the display of a string with linefeed.
IN : Same as mode "h".
hp USE: Starts a new paragraph, then does the same as in mode "h".
IN : Same as mode "h".
hb USE: Add HTML necessary to create a label control into (cis).
IN : cs=Keyname to identify the control with.
os=Label's text. cls=(foreground-background) color code. To make
background transparent, you must Use 6-char code like: (cls="r09y00";)
fns=Font code. i=width in pixels o=Height in pixels.
ib=Positioning flag. ib=true means requesting absolute positioning
jd=Border width in pixels. The default of (jd=0) means no border.
hi USE: Add HTML necessary to create an image control into (cis).
IN : cs=Keyname to identify the control with.
ims=URL of the image. os=Alternative text (optional)
i,o=Image size in pixels j,k=Empty space to leave around image
ds="n/s/e/w/c" Sets how text around is aligned relative to image
ib=Positioning flag. ib=true means requesting absolute positioning
jd=Border width in pixels. The default of (jd=0) means no border.
c USE: Close HTML loading operation. It generates closing tags for all open tags.
Dialog Display:
---------------
d USE: Display Alert Dialog. IN: os=string to be displayed.
dc USE: Display Confirmation Dialog. IN : os=String to be displayed.
OUT: ob=User response. ob=true means [OK] clicked. ob=false means [Cancel] clicked
dp USE: Display Prompt Dialog.
IN : os=String to be displayed, js=Default output string.
OUT: os= String user has entered.
Working on Images:
------------------
Pre-loading: Call method cm("il") supplying it with (cs) and IMS[] containing the URL's
for each image which will be used for the animation.
Image Selection: If you are not running a continuous animation, like when you assign
different image display at mouseOver and mouseOut events, you can request the display
of one image from the preloaded array of images by specifying (cs) and the image order
in its array assigned to (i)
Image Animation: If you are running a continuous animation, make your script conditioned
to run when the image's onLoad event is raised. Supply (cs) and the delay time between
displays assigned to (i)
il USE: Load images. Normally you like this to be at the page top.
IN : cs=Keyname of image control, IMS[]=URL's for all images needed to run in order
is USE: Select an image from loaded array of images.
IN : cs=Keyname of image control, i=Image order in its array.
ia USE: Animate. This script should run whenever the image's onLoad event is raised.
IN : cs=Keyname of image control, i=Number of milliseconds to pause before operation.
Set property for a control:
---------------------------
COMMON IN: cs: Control's keyname.
sc USE: Set foreground color IN:cls=Foreground color code (PC# color code or html hex code)
scb USE: Set background color IN:cls=Background color code (PC# color code or html hex code)
sf USE: Set font IN:fns=Font code
sB USE: Set Bounds.
IN : j,k=Position of control's center relative to window's center if you supply (i,o).
If you don't, it will be position of control's top left corner relative to
window's center.
i,o=Width,Height (Optional) kb=Scroll flag. kb=true means compensate for scroll.
REM: kb=true requires supplying (i,o). If you dont
sl USE: Set label. Applies to button and label controls only
IN : cis=Label's text
su USE: Set update. For Text fields and areas, means the text they contain in (cus)
For Checkboxes and Radio buttons it means "1" or "0" in (cus). For Drop down
lists and single selection lists, it means selected index in (cui). For multiple
lists,it means "1" or "0" for each item indicating "selected" or "unselected"
respectively. All values should be assigned to CUS[]
IN : Either cus,cui or CUS[] as explained above.
se USE: Set editability for Text fields and areas only.
IN : ob=value. ob=true: Rd only txt
sE USE: Enable/Disable a control IN: jb=true: means Enable control.
sv USE: Set visibility of a control IN: kb=true: means Hidden.
sx USE: Set focus.
Get property of a control:
--------------------------
gBX USE: Get Bounds-X.
OUT: o=Position of control's left side relative to window's left side.
gBY USE: Get Bounds-Y.
OUT: o=Position of control's Top relative to window's top.
gBW USE: Get Bounds-W. OUT: o=Control's width.
gBH USE: Get Bounds-H. OUT: o=Control's height.
gl USE: Get label's text. Applies to button and label controls only
OUT: cis=Label's text
gu USE: Get update. For Text fields and areas, means the text they contain in (cus)
For Checkboxes and Radio buttons it means "1" or "0" in (cus). For Drop down
lists, Radio Button groups and single selection lists, it means selected index
in (cui). For multiple lists,it means "1" or "0" for each item indicating
"selected" or "unselected" respectively. All values should be assigned to CUS[]
OUT: Either cus,cui or CUS[] as explained above.
Operations done on Window:
--------------------------
REMARK: All modes operate on the calling window whether it is the main window or a created
subwindow except "wo" Which is called by the main window to create a subwindow.
wo USE: Open a new subwindow
IN : j,k : Location of the subwindow's center relative to the main window's center.
i,o : Width and height of the subwindow.
js : Subwindow's name (optional).
jb : Scrollbars availability. jb=true means install scrollbars on the subwindow.
cis : Text or html to populate subwindow with.
urs : URL of a web page to populate subwindow with
Either cis or urs should be assigned a value, the other one should be empty.
OUT: wnp=Present window object becomes a ref to the new sunwindow.
wp USE: Position window.
IN : j,k : Location of window's center relative to it's containing window's center.
i,o : Width and height of calling window.
kb : "Adjust for Scrolling" flag. kb=true means adjust for scrolling.
ws USE: Resize window. IN : i,o : Width and height wanted for calling window.
wsf USE: Resize window to full screen size.
wsc USE: Resize window to the client size of its containing window,
wwc USE: Get window's client width in pixels. OUT: o
whc USE: Get window's client height in pixels. OUT: o
wwf USE: Get Screen's full width in pixels. OUT: o
whf USE: Get Screen's full height in pixels. OUT: o
Operations done on cookies:
---------------------------
Cookies can be simple or complex. For a simple cookie, make the assignment (js="")
For a complex cookie assign cookie's name to (js) The two strings (ks,os) represent
the key and value of a simple cookie or one "key-value" pair in a complex cookie.
ks USE: Set a cookie. IN: js, ks=key, os=value.
kg USE: Get COOKie value. IN: js, ks=key
Operations done on Form:
------------------------
S USE: Submit form
Performing AJAX operations: (versions 1.54 and higher)
---------------------------
ja USE: Perform ajax call. Send the sever string in (os) and get its response
back also in (os)
IN : os=String to be sent to server.
i=timeout. Allowed time in milliseconds after which process will be aborted
if not done. i=0 means no timeout set for the operation.
jb=Asynchronous op flag. jb=true means do operation asynchronously.
OUT: os=String received back from the server.
_______________________________________________________________________________________
om()
=========
USE: Operations done on (os)
MODES:
Converting the string in (os) to other types:
---------------------------------------------
ti USE: Convert Integer number in (os) to int. IN: os OUT: o
th USE: Convert hex number in (os) to integer. IN: os OUT: o
tc USE: Convert character in (os) to ASCII code. IN: os OUT: o
tf USE: Convert number in (os) to float. IN: os OUT: of
ta USE: Convert concatenated txt lines + \n's in (os) to array.
IN: os OUT: OS[]=Text Lines, oi=number of lines
Converting from other types to (os):
------------------------------------
fi USE: Obtain number in (os) by conversion from int. IN: o OUT: os
fh USE: Obtain hex code in (os) by conversion from int. IN: o OUT: os
fc USE: Obtain char in (os) by conversion from ASCII code. IN: o OUT: os
ff USE: Obtain number in (os) by conversion from float. IN: of OUT: os
fa USE: Make composite string in (os) from string array OS[]
IN: OS[] OUT: os
Other operations performed on (os) or OS[]:
-------------------------------------------
c USE: Cleans (os) It removes all special characters then trims (os) at both sides.
You may use (jb) and/or (kb) to eleminate part(s) of this operation.
IN: os=String, jb="keep leading spaces" flag. If (true) will keep leading.
kb="Trailing spaces flag. If (true) will keep trailing spaces.
u USE: Convert characters of (os) to upper-case IN/OUT: os
l USE: Convert characters of (os) to lower-case IN/OUT: os
_____________________________________________________________________________
rm()
=========
USE: Remote method calls.
MODES:
gi USE: Generates a dynamic image by remotely accessing server methods. The image
is created and automatically displayed into a specified label control.
IN : cs=Label keyname js=Image keyname os=C# code. i,o=Image width, height
kb = Image Caching flag. kb=true means no caching; image must be reproduced.
ib = Image postioning flag. ib=true means absolute positioning.
gt USE: Performs remote access call to a server method which returns data of any type
except image.
IN : os=String to send. Should be loaded with method parameters, mode and required
output variables. Example: os="os='5';mode=oti;out=o"; meaning call om("ti")
with os="5" and get back the value of the resulting (o). If you need more than
one output var, seperate with commas as in: out=os,o,OS to get string (os),
integer (o) and string array OS[].
OUT: OS[] containing values of wanted par's one in each row at same order as requested.
If an array was requested, the received data will be in the form {row0,row1,,..}.
_______________________________________________________________________________________
um()
=========
USE: Utilities
MODES:
c USE: Clear i, j and k based GUV's.
co USE: Clear contents of all (o) based variable.
pn USE: Get current web page name (Example: pg1.aspx). OUT:os
x Use: Mix two colors creating a third one.
IN : cls=Combined PC# color code for the two colors (example: r0b0)
i =Percentage of first color in the mixture.
OUT: cls=Resulting color code in Hex Format.
s USE: Sleep. IN: i= sleep time in milliseconds.
t USE: Timer (upto 1 minute) Returns the time in millisecond intervals which has passed
since last call when (ib) was true.
IN : ib="New reference" flag. ib=true means create new reference. So future times returned
will be made relative to this time.
OUT: ol=Time difference in milliseconds.
Date and Time:
--------------
All the data you are getting can be for current date and time or
for any date and time you choose.
If you want them for current date and time, supply os="".
If you want them for a specific date, supply os="mm/dd/yyyy".
If you want them for a specific date and time supply js="hh:mm:ss" in addition to (os)
gd: USE: Get date as mm/dd/yyyy OUT:os
dt: USE: Get time as hh:mm:ss OUT:os
dw: USE: Get Weekday as Monday OUT:os
dm: USE: Get Month name as January OUT:os
dl: USE: Get date/time long format OUT:os
Mathematical operations:
------------------------
ma USE: Mathematically calculate abs(number) IN: od OUT: od
mc USE: Mathematically calculate ceil(number) IN: od OUT: od
mf USE: Mathematically calculate floor(number) IN: od OUT: od
ml USE: Mathematically calculate log(number) IN: od OUT: od
mx USE: Calculate the maximum of 2 numbers. IN: od , jd OUT: od
mn USE: Calculate the minimum of 2 numbers. IN: od , jd OUT: od
mp USE: Calculate (od) to the power (jd) IN: od , jd OUT: od
ms USE: Mathematically calculate Square Root(number) IN: od OUT: od
mt USE: Mathematically calculate Trigonometric functions.
IN: od, js = function or constant name, could be:
"sin", "cos", "tan", "asin", "acos", "atan" or "pi"
OUT: od
mr USE: Generate a random number in the range (0:i) IN: i=max value OUT: o
________________________________________________________________________________________