Page 202
Quick Nav Bar
<<   Previous Contents
Op Index
Parent User Notes
Index
Glossary
Next   >>


Scripting Quick Reference

In the command summaries that follow, when a parameter is in CAPITAL LETTERS, this means that the parameter is a flag that is either zero or one, or possibly a range such as zero to four. If the latter is the case, the range is specified in square brackets.

If the parameter is in double quotes, then the parameter is a string.

All other parameters are numeric. If WinImages F/x needs a floating point number, then that's how the number will be treated. If WinImages F/x needs an integer, any fractional part of the number will be discarded. So 1.5 is the same as 1 for an integer value.

General Commands to WinImages FX

a=GETALPHA(x,y)

Returns 0-255 value from the action image alpha channel.


a=GETALPHAU(x,y) (retrieves data from the undo buffer)

Returns 0-255 value from the alpha channel of the unmodified copy of the action image in the undo buffer.


a=GETBLUE(x,y)

Returns 0-255 value from the action image blue channel.


a=GETBLUEU(x,y) (retrieves data from the undo buffer)

Returns 0-255 value from the blue channel of the unmodified copy of the action image in the undo buffer.


a=GETGREEN(x,y)

Returns 0-255 value from the action image green channel.


a=GETGREENU(x,y) (retrieves data from the undo buffer)

Returns 0-255 value from the green channel of the unmodified copy of the action image in the undo buffer.


a=GETHUE(x,y)

Returns 0-359 degrees from the action image pixel.


a=GETHUE(x,y) (retrieves data from the undo buffer)

Returns 0-359 degrees from the pixel in the unmodified copy of the action image in the undo buffer.


a=GETLI(POS[0-3])

0=X1
1=Y1
2=X2
3=Y1

This function allows you to retrieve the two endpoints of a freehand area selection; that is, where you start drawing, and where you stop drawing.


a=GETLUMA(x,y)

Returns luma level as 0-255 from action image pixel.


a=GETLUMAU(x,y) (retrieves data from the undo buffer)

Returns luma level as 0-255 from unmodified copy of the action image in the undo buffer.


a=GETPALETTE("name",index,"chan"["r","g","b"])

Returns the red, green or blue component of the specified palette entry as 0-255.


a=GETPALSIZE("name")

Returns the number of colors in the specified palette.


a=GETPROF("name",index)

Returns as 0-255 the value of the named profile at position "index".


a=GETRED(x,y)

Returns 0-255 value from the action image red channel.


a=GETREDU(x,y) (retrieves data from the undo buffer)

Returns 0-255 value from the red channel of the unmodified copy of the action image in the undo buffer.


a=GETSAT(x,y)

Returns saturation as 0-100 from the action image.


a=GETSATU(x,y) (retrieves data from the undo buffer)

Returns saturation as 0-100 from the unmodified copy of the action image in the undo buffer.


a=GETX1(0) [area selection left edge]

Returns left edge of area selection rectangle.


a=GETX2(0) [area selection right edge]

Returns right edge of area selection rectangle.


a=GETXW(0) [action image x width]

Returns total width of the action image.


a=GETY1(0) [area selection top edge]

Returns top edge of area selection rectangle.


a=GETY2(0) [area selection bottom edge]

Returns bottom edge of area selection rectangle.


a=GETYW(0) [action image y height]

Returns total height of the action image.


a=PROGRESS(amount) [returns 1 for abort requested] [amount is of y2-y1]

When a script is invoked, WinImages takes note of the vertical extent of the area selection the user makes. It sets the progress bar so that the bar will respond from zero to the number of Y lines selected. There are several ways this can be used, but the most straightforward is to get the Y selection extents, and then process the selection, passing (Y-Y1) to the progress function. You'll find an example of exactly this type of use in the scripted Image Negative Operator, here.


a=PUTALPHA(x,y,value) [returns previous value]

Writes alpha as 0-255 to the action image.


a=PUTBLUE(x,y,value) [returns previous value]

Writes blue channel as 0-255 to the action image.


a=PUTGREEN(x,y,value) [returns previous value]

Writes green channel as 0-255 to the action image.


a=PUTHUE(x,y,value) [returns previous value]

Writes hue as 0-359 to the action image.


a=PUTLUMA(x,y,value) [returns previous value]

Writes luma as 0-255 to the action image.


a=PUTRED(x,y,value) [returns previous value]

Writes red channel as 0-255 to the action image.


a=PUTSAT(x,y,value) [returns previous value]

Writes saturation as 0-100 to the action image.


a=SELOVAL(x,y,xwidth,ywidth)

This over-rides the area selection the user made and creates an oval area selection as specified. Once used, the original area selection is discarded.


a=SELRECT(x1,y1,x2,xy)

This over-rides the area selection the user made and creates a rectangular area selection as specified. Once used, the original area selection is discarded. Note that the order of x1,x2 and y1,y2 does not matter; they are sorted before being used so that x1 and y1 are left and top, so you can supply them in any order. That means this produces legal rectangles:

10 xw = GETXW(0)
20 yw = GETYW(0)
30 FOR i=1 TO 100
40 x1 = RND()*xw
50 x2 = RND()*xw
60 y1 = RND()*yw
70 y2 = RND()*yw
80 a=SELRECT(x1,y1,x2,y2)
90 a=COLORFILL(RND()*255,RND()*255,RND()*255)
100 NEXT i

a=SETPALETTE("name",index,"chan"["r","g","b"],value) [returns previous value]

This sets the red, green or blue portion of the requested palette. It will return the value of this entry prior to the modification you made.


a=SETPROF("name",index,value) [returns previous value]

This sets the entry specified by the index of the requested profile. It will return the value of this entry prior to the modification you made.


a=TLPOS(n)

This function returns "n" times the position of the timeline as a function of 0 to almost 1; so it will be zero at the first frame, and almost "n" at the last frame. This is intended to produce loops where the 0=1, such as rotation, where 0=360. In that case, you want the last frame of (for instance) of a 30 frame sequence to return 29/30ths instead of 30/30ths. This is because 30/30ths is technically the same thing as 0/30ths. So TLPOS(360) produces 0 at frame zero of thirty, and 348 at frame thirty of thirty... the next frame in the loop is frame zero, and that will produce zero, which is the same as 360 in terms of rotation. Simply put, to rotate continuously, use: TLPOS(360). Here's a continuously rotating asterize suitable for a looping animation:

10 A=ASTERIZE(0,0,255,0,20,TLPOS(360),7,0,1,1)


a=TPOS(n)

This function returns "n" times the position of the timeline as a function of 0 to 1; so it will be zero at the first frame, and exactly "n" at the last frame. For looping animations, TLPOS(n) is usually more appropriate. TPOS(n) generates one continuous sequence. Here is a brightness sequence from 0 to 100%, not suitable for looping:

10 A=BRIGHT(TPOS(100))


Specific Commands to WinImages FX operators

a=ADD(MODE) (0,1,2,3 = add & average,abs,abt/gry,as cloud)

See the Operator Documentation


a=ADDTEXTURE(intensity,TILE)

See the Operator Documentation


a=ANNULAR(red,green,blue,saturation,ADDITIVE)

See the Operator Documentation


a=ANTIQUE(ANTIQUE/UNANTIQUE)

See the Operator Documentation


a=ASTERIZE(red,green,blue,center saturation,width,rotation,arms,CENTER GLOW,ADDITIVE,TAPER)

See the Operator Documentation


a=AURA(width,connect,radiate,seed,spokes,spoke variance,rings,ring variance,innerfade,r,g,b,outerfade,ro,go,bo)

See the Operator Documentation


a=BALANCE(red,green,blue,FORCE DYNAMIC)

See the Operator Documentation


a=BANG(SCROLL[0-4], peaking, T-variance, min, max, detail, resolution, transparency, seed, depth, turb, CLASS[0-2], lo-thresh, hi-thresh, MAX DYN, INVERT, overfill, PALETTE LOCK)

See the Operator Documentation


a=BEND(amount,base,WRAP,ALPHA)

See the Operator Documentation


a=BLUEPRINT(P)

See the Operator Documentation


a=BLUR(percentage)

See the Operator Documentation


a=BRIGHT(percentage)

See the Operator Documentation


a=BUILDPAL(CLEAR,ACCUMULATE,GENERATE,RENDER TRANSPARENT COLOR)

See the Operator Documentation


a=CANVAS(radius/10,amount,TILE,transparency,emboss,BWEMBOSS)

See the Operator Documentation


a=CARIC(percentage)

See the Operator Documentation


a=CELL(red,green,blue,DISCRETE EDGE,TRANSPARENCY,width,height,fade in)

See the Operator Documentation


a=CHANMAP(MODE[0-5],smooth)

See the Operator Documentation


CIRCE

See the Operator Documentation


a=CLIP(ASSIGN AS SOURCE,DISPLAY CLIP,REPLACE IMAGE)

See the Operator Documentation


a=CLIPALPHA(ASSIGN AS SOURCE,DISPLAY CLIP,REPLACE IMAGE)

See the Operator Documentation


a=COLORFILL(red,green,blue)

See the Operator Documentation


a=COLORIZE(hue,saturation,luma,APPLY SATURATION) [luma not applied]

See the Operator Documentation


a=COMBINE(MODE)

See the Operator Documentation


a=CONCENTRIC(cycle,xbias,ybias,SMOOTH)

See the Operator Documentation


a=CONTOUR(red, green, blue, b_red, b_green, b_blue, PLACE BACKCOLOR, interval, EDGE DETECTION)

See the Operator Documentation


a=CONTRAST(percentage)

See the Operator Documentation


a=CONVOLVE(tl,tc,tr,l,c,r,bl,bc,br,threshold,USE THRESHOLD,bias,TWO PASS)

See the Operator Documentation


a=CRATER(impact,variance,seed,level,burrowing)

See the Operator Documentation


a=DERIVATIVE(multiply level,SIGNED,ADDITIVE)

See the Operator Documentation


a=DITHER(x,y,amount,seed,MONOCHROME)

See the Operator Documentation


a=DOF(aperture)

See the Operator Documentation


a=DOME(percentage)

See the Operator Documentation


a=ENCRYPT("password") [password must be 8 or more characters]

See the Operator Documentation


a=ENTRAIN(precipitation,sea level,erosion,sediment)

See the Operator Documentation


a=EXPBLUR(length,amount)

See the Operator Documentation


a=EXFOLIATE(stress,amount)

See the Operator Documentation


a=EXTEND(EDGETYPE,REPLACE,EDGEDIR[0-3],distance,red,green,blue)

See the Operator Documentation


FALSEC

See the Operator Documentation


a=FILMGRAIN(width,height,intensity,seed,POLYCHROMATIC)

See the Operator Documentation


a=FIRE(length, direction, propogation, seed, lat structure, lat turbidity, lng structure, lng turbidity, wobbles, wobble amt, distortion, ADDITIVE, br, bg, bb, mr, mg, mb, er, eg, eb, tr, tg, tb)

See the Operator Documentation


a=FLATMAP(cliff thresh,sea level)

See the Operator Documentation


a=FLICKER(seed,prob(1/X),max,min)

See the Operator Documentation


a=FLIP(H,V)

See the Operator Documentation


FORCED

See the Operator Documentation


a=FRATE(P1,P2,P3[0-2])

See the Operator Documentation


a=GAMMA(P)

See the Operator Documentation


a=GEL(RED,GREEN,BLUE)

See the Operator Documentation


a=GEOELEVATE(sealevel,shading percentage,USE LOADED PALETTE)

See the Operator Documentation


a=GLARE(REDUCE,amount)

See the Operator Documentation


a=GOUACHE(radius,intensity)

See the Operator Documentation


a=GRID(xwidth, ywidth, PRIORITY[0-2], lineweight, start, NUMBERPRIORITY, NEWIMAGE, NUMBER_EVERY_INTERSECTION, number r,g,b, grad r,g,b, background r,g,b, border r,g,b)

See the Operator Documentation


a=HARDALPHA(threshold,amount)

See the Operator Documentation


a=HISTO(GATHER)

See the Operator Documentation


a=HUE(P)

See the Operator Documentation


a=HREMOVE(MODE,R/H,G/S,B/V,1/A)

See the Operator Documentation


INVALPHA

See the Operator Documentation


a=JITTER(seed,DIRECTION[0-2],probablility,spoke interval,max spokes,interstitial width,R,G,B,A)

See the Operator Documentation


a=JULIA(p1,p2,zoom,xpan,ypan,palette offset,LAMBDA)

See the Operator Documentation


a=KALEIDO(mirrors,ROTATIONAL,angle)

See the Operator Documentation


a=KEYIN(red,green,blue,rdev,gdev,bdev,KEY ON SOURCE,INVERSE,SOFT)

See the Operator Documentation


a=KEYTOALPHA(INVERT,SOFT,red,green,blue,rdev,gdev,bdev)

See the Operator Documentation


a=LANDCLIFF(CLIFFING,steepness)

(see the LANDSCAPE() operator)


a=LANDHAZE(hazelevel,fog linearity)

(see the LANDSCAPE() operator)


a=LANDROT(x,y,z,lx,ly,lz)

(see the LANDSCAPE() operator)


a=LANDSCALE(x,y,z)

(see the LANDSCAPE() operator)


a=LANDSCAPE(elevation,palette mix,grid scale,WIREFRAME)

LANDSCAPE() is the command that actually runs the operator. Before you call LANDSCAPE(), you should call these functions that set up the other LANDSCAPE() variables:

LANDWATER()
LANDTEXT()
LANDSCALE()
LANDROT()
LANDHAZE()
LANDCLIFF()

These functions may be called in any order, except that LANDSCAPE() must be called last.

See the Operator Documentation


a=LANDTEXT(separation,tex depth,cam depth,TEXTURING,STEREO,PERSPECTIVE,ambient)

(see the LANDSCAPE() operator)


a=LANDWATER(WAVES,level,skyreflect)

(see the LANDSCAPE() operator)


a=LIGHTNING(width,direction,branching,seed,zag,red,green,blue,saturation,glow,taper,ADDITIVE)

See the Operator Documentation


a=LINED(red,green,blue,PLACE BACK,rback,gback,bback,height)

See the Operator Documentation


a=LINFILL(angle,cycle,SMOOTH)

See the Operator Documentation


a=MAKEALPHA(MASK WITH SOURCE LUMA,MASK WITH EXISTING ALPHA,MODE,fill value)

See the Operator Documentation


a=MAKEAREA(UPDATE TIMELINE WITH AREA)

See the Operator Documentation


a=MAKEFIELDS(DOMINANCE,REPLACE)

See the Operator Documentation


a=MELT(amount,DIRECTION[0-3],start,end)

See the Operator Documentation


a=MANDELBROT(p1,p2,zoom,xpan,ypan,palette offset)

See the Operator Documentation


a=MAXIMUM(MODE[0-6],AFFECT ONLY ALPHA or REPLACE ALPHA)

See the Operator Documentation


a=MERGE(WARP,REFLECT,TILE)

See the Operator Documentation


a=MINIMUM(MODE[0-6],AFFECT ONLY ALPHA or REPLACE ALPHA)

See the Operator Documentation


a=MIRROR(angle)

See the Operator Documentation


a=MONOCHROME(MODE)

See the Operator Documentation


a=MOTIONBLUR(length,direction,amount)

See the Operator Documentation


MULTIPLY

See the Operator Documentation


a=NEGATIVE(MODE(0-5),CHAN1(r/h/c),CHAN2(g/s/m),CHAN3(b/v/l/y),CHAN4(k))

See the Operator Documentation


a=NET(red,green,blue,width,height,hori move, vert move,line width)

See the Operator Documentation


a=NLOG(exp)

See the Operator Documentation


a=NTSC(FILTER,LIMIT)

See the Operator Documentation


a=OIL(P)

See the Operator Documentation


a=OUTFILL(width,generations,cycles,INSIDE,SMOOTH,REPEAT,CRYSTAL)

See the Operator Documentation


a=PAGECURL(shadow,v-priority,corner[0-3],transparency,exr,exg,exb,hir,hig,hib,ALPHA)

See the Operator Documentation


a=PARTICLES("root:\path\filename.psy")

See the Operator Documentation


a=PERSPECTIVE(xrot,yrot,zrot,xpos,ypos,zpos,hzoom,vzoom)

See the Operator Documentation


a=PIXELIZE(red,green,blue,width,height,edge)

See the Operator Documentation


a=PLACE(MODE) (1==only in area selected)

See the Operator Documentation


Plug-Ins

Since a plug-in may have up to 67 parameters (though this is unlikely), we use a fairly flexible approach to get at individual parameters without getting too complex with function arguments.

With the exception of the radio button sets, the various types of plug-in settings are arranged either left to right or top to bottom. The "which" parameters below specify which unit, left to right or top to bottom. For instance, a=PUCHECK(2,1) checks the second checkmark from the left.

The radio buttons are arranged as the set of 8, the two sets of four, and the two sets of two. Left-to right ordering applies to both the sets of four and the sets of two.

The following functions may be used to set up any portion of a plug-in function:

a=LOADPLUG("path_and_file.wis")
a=PUPALNC(Number_of_Colors_In_Palette[2-1024])
a=PUSTRING(which_string[0-1],"string")
a=PURADIO(which_radio[0-4],selection[0-7]) (selection may be [0-3] or [0-1])
a=PUCHECK(which_check[0-7],VALUE)
a=PUFLOAT(which_float[0-7],value)
a=PUINTEGER(which_int[0-7],value)
a=PUPROFILE(which_profile[0-11],index[0-200],value[0-255])
a=PURGBA(which_rgba[0-3],r,g,b,a)
a=PUPALRGB(which_palette[0-1],index[0-1023],r,g,b)
a=PUCMD(command_number[0-29]) (immediately executes command button)

Once the plug-in function is set up, call this to run it:

a=PLUGIN()

See the Operator Documentation


POLARREC

See the Operator Documentation


a=PROMOTERGB(RED,GREEN,BLUE,GREY,INVERT)

See the Operator Documentation


PSEUDO

See the Operator Documentation


a=RADIAL(cycle,xbias,ybias,SMOOTH)

See the Operator Documentation


a=RADWAVE(distortion,frequency,halfwaves,radius,phase,shading)

See the Operator Documentation


a=RAYTRACE(ANTIALIAS,recursion levels,"tracepath","tracefile") [0==no antialiasing]

See the Operator Documentation


a=REFRACT(rotation)

See the Operator Documentation


a=RELIEF(percentage)

See the Operator Documentation


a=REMAP(offset,nearness)

See the Operator Documentation


a=REMOVE(samples)

See the Operator Documentation


a=RIC(percentage, size)

See the Operator Documentation


a=RIP(TL,TC,TR,L,R,BL,BC,BR,RTL,RTC,RTR,RL,RR,RBL,RBC,RBR,threshold,MODE[0-6],IGNORE WORST)

See the Operator Documentation


a=RIS(v-percent, h-percent)

See the Operator Documentation


a=ROLL(x,y,WARPSCROLL)

See the Operator Documentation


a=ROTATE(degrees,IN-PLACE)

See the Operator Documentation


a=RTILE(red,green,blue,h size,v size,x move,y move,size change,line width)

See the Operator Documentation


a=RULER(ALIGN,offset,start,NUMPRI,NEWIMAGE,nr,ng,nb,na,gr,gg,gb,ga,bar,bag,bab,baa,bor,bog,bob,boa)

See the Operator Documentation


a=SAMPLE(MAKE KEY COLOR,INCLUDE EXTREMES)

See the Operator Documentation


a=SAMPLEA(MODE[0-2]) (result is SAMPLE)

See the Operator Documentation


a=SAT(percentage)

See the Operator Documentation


a=SCANLINE(ODD,width)

See the Operator Documentation


a=SHARPEN(percentage,width)

See the Operator Documentation


a=SHAVE(severity,DIRECTION[0-2])

See the Operator Documentation


a=SHAVEALPHA(percentage)

See the Operator Documentation


a=SHEAR(amount,base,WRAP,ALPHA)

See the Operator Documentation


a=SHINE(width,height,amount,threshold)

See the Operator Documentation


a=SOFTENA(percentage)

See the Operator Documentation


SOLARIZE

See the Operator Documentation


a=SPERCENT(x%,y%,REPLACE,MODE)

See the Operator Documentation


a=SPIRALBLUR(radius,rotation,amount)

See the Operator Documentation


a=SPIXEL(x,y,REPLACE,MODE)

See the Operator Documentation


a=STABILIZE(Poi X, Poi Y,Disp x,Disp y,EDGES SETTING,red,green,blue,alpha,TILE=0 or STRETCH=1)

Note that only when the EDGES SETTING is set to 0 will the colors make a difference, but the scripting engine requires all parameters so these must be set.

See the Operator Documentation


a=STAPP(ABS,HUE,SMOOTHING)

(see the STROKE() operator)


d a=STBARREL(pour,reseed,norep,reverse,zero,random,seed)

(see the STROKE() operator)


a=STFADE(MODE[0-4])

(see the STROKE() operator)


a=STFLIP(seed,RESEED,HMETHOD[0-2],VMETHOD[0-2])

(see the STROKE() operator)


a=STPAL(SMOOTH,WRAP)

(see the STROKE() operator)


a=STPOS(spacing,roughness,seed,RESEED,GHOSTWRITE)

(see the STROKE() operator)


a=STROKE()

STROKE() is the command that actually runs the operator. Before you call STROKE(), you should call these functions that set up the other STROKE() variables:

STAPP()
STBARREL()
STFADE()
STFLIP()
STPAL()
STPOS()
STROTATE()
STSHADOW()
STSIZING()

See the Operator Documentation


a=STROTATE(rot1,rot2,seed,RESEED,METHOD[0-5])

(see the STROKE() operator)


a=STSHADOW(ON,level,soft,xo,yo)

(see the STROKE() operator)


a=STSIZING(size1,size2,seed,RESEED,METHOD[0-4])

(see the STROKE() operator)


a=SUBTRACT(MODE)

See the Operator Documentation


a=SURFWARP(direction,amount,mid level,shading)

See the Operator Documentation


a=SWAPRGBA(MODE[1-6])

See the Operator Documentation


a=SWIRL(degrees)

See the Operator Documentation


a=TEXTURE(type,SCROLL[0-4],ILLUMINATE,T-variance,detail,resolution,seed,depth,turb,CLASS[0-2],lo thresh,hi thresh,MAX DYNAMIC,INVERT,OVERWRITE)

See the Operator Documentation


a=TILER(n,m,framex,framey,PRIORITY,scaling,ALIGN)

See the Operator Documentation


TOONIZE

See the Operator Documentation


a=TRANSITION(time[0.0-1.0],PRIORITY[0,1,2],SCALE,"path","filename")

See the Operator Documentation


a=TRUNCATE(MODE[0-7],RED,GREEN,BLUE,ALPHA,value)

See the Operator Documentation


a=TURBULENCE(swirls,swirliness,movement,seed)

See the Operator Documentation


a=TURN90(MODE[0-3])

See the Operator Documentation


a=VALUE(percentage)

See the Operator Documentation


a=VARIANCE(multiply,width,ADDITIVE)

See the Operator Documentation


a=VREMOVE(MODE,R/H,G/S,B/V,1/A)

See the Operator Documentation


a=WATERCOLOR(percentage[0-100])

See the Operator Documentation


a=WAVES(xwaves,xfront,xside,ywaves,yfront,yside,shading,xphase,yphase)

See the Operator Documentation


WONK

See the Operator Documentation


BASIC-like Commands Available

ABS(n)

Returns the absolute value of the parameter (a positive number.)


ASC("string")

Returns the ASCII code for the character in the string.


ATN(n)

Returns the arc-tangent of the parameter in radians.


CHAINP filename

Brings in new program lines. The old program data is discarded. Variables that have been marked by the use of the COMMON statement are retained, other variables are discarded.


CHR$(n)

Returns the ASCII character represented by the numeric parameter.


CLEAR

Resets all numeric variables to zero and text variables to empty.


CLOSE #n

Closes the open file by its channel number.


COMMON variable[,variable...]

This identifies a variable as one that gets passed along to a program that you bring in using the CHAINP command.


COS(n)

Returns the cosine of the paramater in radians.


DATA constant[,constant...]

Stores constant values for use with the READ function.


DATE$

Returns the current date as a string.


DAY$

Returns the day (1-31) as a string.


DEF UFfunction-name([arg[,arg...]])

Defines a function that you construct. The function name must begin with the capital letters UF (for User Function). The variables named in the left side of the statement control what is passed to the function.

The following simple example implements a negative function using inverse luma:

 10 REM shows how to use DEF
 20 DEF UFNUG(uuu,vvv) = 255-GETLUMA(uuu,vvv)
 40 X1=GETX1(0): Y1=GETY1(0): X2=GETX2(0): Y2=GETY2(0)
 50 FOR Y=Y1 TO Y2
 60   A=PROGRESS(Y-Y1): IF A=1 THEN END
 70 FOR X=X1 TO X2
 80     a = PUTLUMA(X,Y,UFNUG(X,Y))
 90   NEXT X
100 NEXT Y


DEG(n)

Returns the degree value equivalent to the specified number in radians.


DIM variable(n[,n...])

Examples:

10 DIM a(10,20)
20 DIM B$(100,3)


END

This command terminates the script immediately.


EOF(#n)

Returns -1 if the device referenced is at the end-of-file, otherwise returns zero.


ERASE variable[,variable...]

Erases variables.


EXP(n)

Returns exponential of parameter.


FIELD #n, o AS s$ [, p AS t$...]

This allocates space in a random file buffer for device indicated by #n, allocating o bytes and assigning the bytes at this position to the variable s$, etc.


FOR n=x TO y [STEP z]

Example:

10 FOR I=0 to 10 STEP 2
20 print "The number is ";I
30 NEXT I


GET #n [,record number]

GET reads the next record from a random-access file or device into the buffer associated with that file. If record number is specified, GET reads the specified record.


GOSUB line

This jumps to the specified line and begins execution. However, when it jumps, it remembers where it was when it jumped; when, at the new location, it encounters a RETURN statement, the script will resume execution at the statement or line immediately following the GOSUB statement.


GOTO line

This jumps to the specified line and begins execution there.


HEX$(n)

Returns a string which is the base-16 equivalent of the parameter n.


HOUR$

Returns the current hour as a string 0-23.


IF expression THEN statement [ELSE statement]

Example:

10 A=5
20 IF A=5 THEN PRINT "it was 5" ELSE PRINT "it was something else"


INSTR([start,] string, pattern)

Used to search for the pattern in the string. If found, will return the character position in the string where it exists; otherwise, it will return 0.


INT(n)

Discards the fractional part of the number, if any, and returns the integer part.


KILL "filename"

Deletes the specified file.


LEFT$("string",n)

Returns the leftmost n characters of the string.


LEN("string")

Returns the length of the string.


LET variable=expression (OPTIONAL)

Optional assignment statement. These do the same thing:

10 LET A=5
20 A=5


LOC(#n)

LOC returns the next record that GET or PUT statements will use.


LOF(#n)

Returns the length of the file specified by #n (see OPEN)


LOG(n)

Returns natural log of parameter.


LSET x$ = expression

Transfers data from expression to the left hand side of a string variable or random access buffer field.


MERGEP filename

Brings in new program lines from a file. The current program is retained, and varables are not reset. To reset variables and discard the current program, use CHAIN instead.


MID$("string",start[,len])

Returns a substring of len length (if provided) starting at start.


MINUTE$

Returns a string of minutes 0-59.


MONTH$

Returns a string for month, 1-12


NAME oldfile AS newfile

Renames the specified file.


NEXT

Used with FOR


ON variable GOSUB

Allows you to associate a series of subroutines with different values of a variable. Example:

10 A=2
20 ON A GOSUB 100,200,300
30 PRINT "We're back..."
40 END
100 PRINT "sub 1":RETURN
200 PRINT "sub 2":RETURN
300 PRINT "sub 3":RETURN


ON variable GOTO

Allows you to associate a series of jump-out targets with different values of a variable. Example:

10 A=2
20 ON A GOTO 100,200,300
30 PRINT "Whoops - A was not matched!"
40 END
100 PRINT "target 1":END
200 PRINT "target 2":END
300 PRINT "target 3":END


OPEN "O"|"I"|"R", #n, filename, [,recordlength] filename FOR INPUT|OUTPUT|APPEND AS #n [,LEN=recordlength]

You can actually use OPEN two ways:

  1. OPEN "O"|"I"|"R", #n, filename [,recordlength]
  2. OPEN filename FOR INPUT|OUTPUT|APPEND AS #n [,LEN=recordlength]

The first form, with the O/I/R options, allows you to select sequential or random file access. The R option is the random access option, while I and O are sequential.

The second form allows only sequential file access.

See the PRINT statement for an example of the use of the second form.


OPTION BASE n

Controls the referencing of arrays. With OPTION BASE 1 in effect (the default), this statement:

10 DIM A(10)

…will result in array elements from A(1) through A(10).

With OPTION BASE 0 in effect, this statement:

10 DIM A(10)

…will result in array elements from A(0) through A(9).


POS

Returns a number represeting the character position on the output (PRINT) line.


PRINT [#n]|[USING format] expressions

PRINT is the means to write information to dialogs in WinImages F/x, and also to files. Used by itself as PRINT expression, output is sent to WinImages F/x. Used with a device number and an open file, you can write almost anything to the file.

PRINT expressions are text strings or variables separated either by commas, which act as TABs, or by semicolons, which act to juxtapose one portion of an expression next to the next portion. Examples:

10 PRINT "This is a test."
20 A=5
30 PRINT "The value of A is ";A
40 B=7
50 PRINT A,B
60 OPEN "c:\scripttest.txt" FOR OUTPUT AS #1
70 PRINT #1,"Data for the file"
80 PRINT #1,"A+B=";A+B
90 CLOSE #1


PUT #n[,recordnumber]

PUT outputs the next available record or the record specified by recordnumber to the specified channel.


RAD(n)

Returns the radian value equivalent to the specified number in degrees.


RANDOMIZE n

Seeds the script language random number generator.


READ variable[,variable]

Reads information contained in DATA statements.


REM ignored content


RESTORE

Resets the READ statement so that it points back to the beginning of the information contained in the DATA statements.


RETURN

This statement is only used in subroutines. When you call a subroutine with GOSUB, this statement causes execution to result at the line or statement following the GOSUB call.


RIGHT$("string",n)

Returns the rightmost n characters of string.


RND(0)

Returns a random number ranging from zero to 1.


RSET x$ = expression

Places the data specified by expression into the right side of a string variable or random access buffer field.


SECOND$

Returns a string representing seconds in the range 0-59.


SGN(n)

Returns either -1, 0 or 1, depending on the sign of the argument.


SIN(n)

Argument n is in radians.


SPACE$(n)

Returns a string with n spaces in it.


SQR(n)

Square root function.


STR$(n)

Returns a string of the number.


STRIP("string")

Removes all leading and trailing spaces and tabs from a string, but does not remove any that are "interior" elements, that is, that might be separating words or numbers interior to the string.


SWAP variable,variable

Swaps two variables of identical types.


TAB(n)

Sends spaces until the column indicated by n is reached. Intended to be used with PRINT.


TAN(n)

Argument is in radians.


TIME$

Returns the current time as a text string.


VAL("string")

Returns the value (a number) of a string that contains a text representation of a number.


WEND

Ends a WHILE loop, see WHILE.


WHILE expression

Will loop as long as the expression evaluates as true (-1).


WIDTH #n,n

Sets the number of columns assumed to the be the full width of the specified output channel.


WRITE #n,expression[,expression]

Somewhat like print; outputs variables in a formatted manner.


YEAR$

Returns a string containing the year.


Quick Nav Bar
<<   Previous Contents
Op Index
Parent User Notes
Index
Glossary
Next   >>
Page 202

WinImages F/x, WinImages Morph and all associated documentation
Copyright © 1992-2001 Black Belt Systems ALL RIGHTS RESERVED Under the Pan-American Conventions
In accordance with the Computer Software Rental Act of 1990:
This software may not be rented, lent, or leased.

WinImages F/x Manual Version 7, Revision 0

HTML Documentation Management System © 2000-2001 Black Belt Systems