Contents 

Fast Start
Weight Scale Interfacing (Digi D770)
What Is Visual Builder?
What's New In Visual Builder?
Creating A CAPITAL Form
Creating a Form - Conceptual Overview
Creating a Form - Quick Guide For Advanced Users
The Forms Wizard
Creating A CAPITAL Report
The Label Wizard
Report Wizard Tutorial
New & Revised Topics in CAPITAL 7.5
AllocatePayment()
CrossTab()
CreateTable()
EventAdd()
FilterTable()
Find()
PayMethodName()
ReadINI()
SendHTMLMail()
TranInfo()
WriteNote()
New & Revised Topics in CAPITAL 7.41
AddPayment()
Business Functions Listing
BufferCommit()
BufferRollBack()
BufferUpdates()
ExportASCII()
GetFolder()
KitList()
LockRecord()
ReadNote()
ReadTextFile()
StockQuantity()
StrWrap()
WriteTextFile()
New & Revised Topics in CAPITAL 7.4
Business Functions Listing
CompanyName()
Department()
Field Objects
JobInfo()
Linking
Moving & Resizing Body Objects
Operators & Expressions
OrderTable()
PathData()
Picture Object Properties
ReadINI()
ReadNote()
RunApplication()
Sample Scripts
Send Product Info Email With Pictures
Start-up Switches
StockAnalysis()
TagInfo()
TranWrite()
WriteINI()
New & Revised Topics in CAPITAL 7.3
AddStock()
AddTraceProperty()
BackAllocate()
Business Functions Listing
CardFileBill()
ComError()
ComClose()
ComOpen()
ComRead()
ComSetup()
ComWrite()
ComputerName()
EchoBox()
EchoBoxOn()
EchoBoxOff()
LockSemaphore()
PasswordInfo()
ScriptRun()
TodoAdd()
Trouble-Shooting Guide
UnlockSemaphore()
New & Revised Topics in CAPITAL 7.2
Business Functions Listing
ImportASCII()
Journal()
ReadNote()
StockGetQuantity()
StockQuantity()
TimeFormat()
Version()
Basic Editing
Moving & Resizing Objects
Moving & Resizing Body Objects
Creating Forms & Reports
Form Bodies
Form Design Hints & Tips
Body Properties
Body Contents
Rule Wizard
Rule Wizard Guidelines
Body Rules
Group Wizard
Body Groups & Totals
Form Output Properties
Form Notes
Question Wizard
Form Question Prompt
Form Questions
Preface and Postscript Scripts
Form Dictionaries
Page Setup
Form Editor Preferences
Field Objects
Field Formulas
Bar Code Field Objects
Text Object Properties
Picture Object Properties
Linking
Why are Table Joins Necessary?
Linking Forms - Concepts
Linking Forms - Tutorial
Linking Forms - Hints & Problem Solver
Special Topics
CAPITAL Data Browser
Bar Codes - An Overview
Cross-Tab Concepts
Cross-Tabs
Cross Tab Fields
Cross-Tab Hints & Tips
Exporting Data
Printing
Transaction (Form) Printing
The Print Job Manager
Windows Printing Concepts
Script Programming
Business Functions Listing
Capital Business Script
Variables & Data Types
Scope
Operators & Expressions
Type Conversion
Business Functions Overview
Commands
CALL
DEBUG
GOTO (label)
IF (expression) GOTO
IF (expression) ... ELSE ... ENDIF
PAUSE
REM (*)
RETURN
Visual Forms Builder Special Variables
Sample Scripts
Sending Email Using CBS
Programmer's Frequently Asked Questions
Business Functions
AAdd()
Abs()
AddCustomer()
AddJobCard()
AddMail()
AddPayment()
AddRecord()
AddStock()
AddTraceProperty()
AllocatePayment()
Alltrim()
AnswerYes()
ArraySort()
Asc()
AsChar()
ASIZE()
AsTran()
AsVal()
AT()
BackAllocate()
BPayCRN()
BPayError()
BufferCommit()
BufferRollBack()
BufferUpdates()
CDOW()
Ceil()
CHR()
CloseFile()
CloseIndex()
CloseTable()
CMONTH()
CompanyName()
CompressTable()
ComError()
ComClose()
ComOpen()
ComRead()
ComSetup()
ComWrite()
ComputerName()
CopyFile()
CopyRecord()
CopyToClipBoard()
CreateFile()
CreateEmailJob()
CreatePrintJob()
CreateTable()
CrossTab()
CTOD()
DateFormat()
DateFromMonth()
DAY()
Dictionary()
DOW()
DTOC()
DTOS()
Echo()
EchoBox()
EchoBoxOff()
EchoBoxOn()
EchoStatus()
Eof()
EraseFile()
EventAdd()
ExpenseAnalysis()
ExportASCII()
FilterTable()
Find()
FindWindow()
ForDate()
FormAdd()
FormResult()
FreeCPU()
FormCreate()
FormShow()
GetField()
GetFolder()
Goto()
GotoBottom()
GotoTop()
HoldRecord()
GroupChange()
Idle()
IF()
ImportASCII()
IndexTable()
Input()
InputFile()
INT()
IsEmpty()
IsFile()
IsFileEnd()
IsLayBy()
IsPaid()
IsPayment()
JobInfo()
JobPriority()
JobStatus()
KitList()
LEFT()
LEN()
LockRecord()
LOWER()
LTRIM()
Max()
Min()
ModemDial()
Month()
MonthEnd()
MonthStart()
NTrim()
NumToWord()
OpenFile()
OpenTable()
OrderTable()
OpenVisualBuilder()
Pad()
PathCompany()
PathProgram()
PayMethodName()
PostMessage()
PriceUpdate
RAT()
ReadFile()
ReadNote()
ReadFileLine()
ReadTextFile()
RecNo()
RenameFile()
Replicate()
Right()
Round()
Rtrim()
RunApplication()
Seconds()
Security()
SendDirect()
SendMail()
SendEscapeCodes()
SendMail()
Shell()
Skip()
Space()
SpecialName()
SpecialPrice()
SQRT()
StockAnalysis()
StockDescription()
StockMovement()
StockPrice()
StockId()
StockQuantity()
Str()
StrLine()
StrLineCount()
Strtran()
StrWrap()
Substr()
StrZero()
Time()
Today()
TodoAdd()
TranAdd()
TranCreate()
TranWrite()
TranInc()
Transform()
TranStr()
Type()
UnlockRecord()
Unpaid()
Upper()
UserName()
UserNumber()
Version()
WaitCursor()
WaitFile()
Week()
Write()
WriteFile()
WriteFileLine()
WriteNote()
WriteTextFile()
Year()
ZipFile()
Tutorials
Report Wizard Tutorial (Basic)
Label Wizard Tutorial (Advanced)
Forms Library
The Visual Builder Report & Forms Library
Forms Stationary
Report Library - Customer Transactions
Report Library - Cash Management
Report Library - Sales Analysis
Report Library - Sales Orders & Back Orders
Report Library - Stock Control
Report Library - Service Management & Periodic Billing
Report Library - Special
Appendix
Moving Forms
Logging On
Overriding Print Warning Messages
Questions & Answers
Start-up Switches
Trouble-Shooting Guide
Weight Scale Interfacing (Digi D770)
Working With Text Printers

CAPITAL Series 7 Visual Builder Reference Guide

Prev Page Next Page

FormAdd() generate/enh73.gif


Add a control to the dialog window created with FormCreate().

Syntax

FormAdd([<cLabel>], [<xInitial>], [<xParam>], [<cMessage>]) --> lSuccess

Arguments

<cLabel> --> The text message prompt to appear in front of the control.

<xInitial> --> The initial value to assign the control.

<xParam> --> Is a parameter related to the value assigned to the form control.

<cMessage> --> An optional status bar message used to explain the purpose of the input.

Returns

Returns TRUE if the control was successfully added to the form dialog window, otherwise FALSE indicates failure.

To query the contents of the various controls on the form after input is finished see the function FormResult().

Description

This function is used to add a controls to a form dialog window before it is displayed. The type of control created is determined by xInitial's value.

Character String Input

<xInitial> --> This is the initial value to assign the edit control that will be created.

<xParam> --> You may either pass the length (size) of the control or a suitable picture format.

If the length (size) is longer than the contents of xInitial, then the edit control will be extended to that size, otherwise if it is smaller, the edit control length will correspond to the supplied size, and automatic horizontal scrolling will be activated.

<cMessage> --> an optional message to appear on the status bar.

Date Input

<xInital> --> Pass the date value. For example, Today() or CTOD("12/06/02") or CTOD("").

<xParam> --> do not pass any parameter here for dates.

<cMessage> --> an optional message to appear on the status bar.

Checkboxes (Yes/No Questions) Input

<xInital> --> TRUE or FALSE. This is the initial value of the checkbox. TRUE = ticked and FALSE = unticked.

<xParam> --> TRUE or FALSE. The value of TRUE left justifies the checkbox/question. A value of FALSE right justifies the checkbox.

Edit Box Input

<xInitial> --> the initial character string value or a blank string ("").

<xParam> --> a two dimensional array which specifies the width and height in characters. For example, { 20, 4 }

Combobox (List of Choices) Input

<xInitial> --> The initial selection from the available list of choices as a character string. For example, "Male". If not specified, item 1 from the list of choices will be selected by default.

<xParam> --> The list of available choices as an array of character strings. For example, { "Male", "Female" }

generate/notepad.gifTo display a combobox <xInitial> must be passed as a character string. This string should match one of the entries of the parameter list.

Radiobutton input

<xInitial> --> The number of the selected radiobutton.

<xParam> --> An array of character strings that represents the different choices. For example, { "Cat", "Dog", "Mouse", "Fish" }

generate/notepad.gifOnly one set of radiobuttons may be specified per form window.

generate/notepad.gifTo display a radiobutton <xInitial> must be specified as a number.

Separator

To add a gap between controls call FormAdd() without parameters.

Text Label

To add a text label in a bold font, specify a <cLabel> but do not specify an <xInitial>

Passwords

Assign xParam the value "*" to prompt for a password. Input as it is typed is not echoed to the screen. Asterisk (*) characters are displayed instead.

Example #1

FormCreate()

* Create an edit control with the label 'Name'

* assign it a blank initial value and make it 20

* characters wide

FormAdd("Name", "", 20, "Please enter your name.")

* Create an edit control with the label 'Number'

* and assign it the value "123" and only allow

* numbers to be entered

FormAdd("Number", "123 ", "99999999")

* Prompt for today's date

FormAdd("Today's Date", Today())

* Display an edit box

FormAdd("Notes", "", { 30, 4 })

* Present a list of choices

FormAdd("Sex", "Male", { "Male", "Female" } )

* Present a list of radiobuttons and mark the first (1)

* entry "Cat" as selected.

FormAdd("Animal", 1, { "Cat", "Dog", "Mouse", "Fish" } )

FormShow("Example Form Window")

Example #2

* Prompt for normal input and password input

Declare cPass Type String

Declare cName Type String

cPass := " "

cName := " "

FormCreate()

FormAdd("Name", cName)

FormAdd("Password", cPass, "*")

FormShow("Log in")

cPass := FormResult(2)

Echo(cPass)

Example #3

* Show 'Account Process' in bold and then

* prompt 'For Your Name'

FormCreate()

FormAdd("Account Process")

FormAdd()

FormAdd("Enter Your Name", SPACE(20))

FormShow("Example #3")

generate/notepad.gifFor more information on picture formats see the topic: Variables & Data Types.

____________________________

Related Topics

Business Function List

FormCreate()

FormResult()

FormShow()