Technical Issues - BASIC Tutorial III - Examples

Other topics: Getting Started, and Advanced BASIC

AddNoise.bas (DESIGN)

This simple but very useful program simulates measured spectrophotometer data (exaggerated above). Such spectra are useful when testing various methods for deducing n,k. An appreciation of this capability can be had in our paper 'Gedankenspektrum' methods... (page 4).


BandEdgePlot.bas (DESIGN/MEASURE)

This program utilizes BASIC Sub EdgeCalc. We start with permanent annotation Edgerstoune Precision Optics (saved in DESIGN Graph Axes or MEASURE Scan Method). Refer to the BandEdgePlot.bas code listing to see how annotations are added to existing ones. Click here for the general method of implementing annotations in FilmStar BASIC.


Bbhr.bas (DESIGN)

Some designers prefer to construct broadband reflectors from multiple QWOT stacks. Another approach is to utilize  continuously varying layers. Tolerancing analyses might help users decide which method is superior.


ExcelTable.bas (DESIGN)

ExcelTable.bas utilizes BASIC Sub GetTableData which returns R,T and phase. It illustrates the important Excel property Cells {i.e. xlSheet.Cells(kRow, kCol) = Rp} for inserting values into al worksheet. A simpler but less flexible approach is given in MultCalcXL.bas (below).

As with any BASIC program communicating with Excel, the correct Object Library must be specified. Click Edit.. References, delete any bad reference and add the reference corresponding to your Excel version. Here Excel 2010 is specified.


LayerErrPlot.bas (DESIGN)

LayerErrPlot.bas can help optical coaters determine whether out-of-spec AR coatings suffer from layer errors or tooling factor errors. It illustrates how to programmatically create graph legends.


MultCalcXL.bas (DESIGN)

As an alternative to ExcelTable.bas (above), the FilmStar Workbook saves spectral tables in Excel XLS format (version 5.0/95). Excel is not required.


Scan & Show Average.bas (MEASURE/Scantraq)

This is a simple example showing how to calculate in BASIC and create simple annotations. While the same quantities can be computer in the Workbook, this seems simpler. The same program works in DESIGN with slight modification:

Remove DataType = 1 and replace Scan by Calculate

nDat = UBound(yDat, 1)
ySum = ySum + yDat(i, 1)   ' reflectance
ySum = ySum + yDat(i, 2)   ' transmittance


WaveShow.bas (MEASURE/Scantraq)

WaveShow.bas provides another example of automatically generated FSPlot annotations.

Users can manually modify annotations by selecting (cursor changes to hand) and replacing. For example, one might move the label 675.0 to the bottom of the graph by selecting Bottom:

Copyright © 2023 FTG Software Associates
Last updated on January 31, 2023