Knowledge Base

Welcome to The Carlisle Group's Knowledge Base.

Search or Ask a Question

This is a keyword search that looks for matching articles that contain one or more words specifically by a user in articles’ tags, title and content. Admin writes brief intro content here via admin end. If you are unable to find an answer to your issue, please submit an issue here.

Back to Articles List

Sample Script - Create new static fields from user input. | CAS 6.0

Added: 07/17/2015; Last Modified: 01/25/2016; Visits:1,929

⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝
⍝⍝ Description = Create four new fields with user input static values
⍝⍝
⍝⍝ Written By  = The Carlisle Group
⍝⍝ Date        = Jul 17, 2015 09:46
⍝⍝ CAS         = 6.0.317
⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝


⍝ Create a Wizard with defined inputs.
 W←Wizard.New''
 W.Start''
 WGI←WizGetInputs.New W
 WGI.Title←CharString.New'Insert new static fields.'
 WGI.AddInput'Edit' 'TextInput' 'Text Input:'
 WGI.AddInput'Blank' 'Blank1' ''
 WGI.AddInput'CheckBox' 'TFInput' 'True/Flase Input:'
 WGI.AddInput'Blank' 'Blank2' ''
 WGI.AddInput'DatePicker' 'DateInput' 'Date:'
 WGI.AddInput'Blank' 'Blank3' ''
 WGI.AddInput'DropCombo' 'DropInput' 'Drop Combo:' 'one,two,three'
 WGI.Run''


⍝ Create a blank RecordSet
⍝ Blank RecordSets need special attention to add the first column.  See RecordSet.AddColumn
 RS←RecordSet.New''


⍝ Add the first field to a blank RecordSet.  AddColumn must be used and it
⍝ must have a valid Field as an input.  The block below demonstrates how tochar
⍝ create a Field from a CharString.
 TI←CharString.New WGI.Get'TextInput'
 SL←StringList.New''
 SL.Add TI
 FIELD←SL.ToField''
 FIELD.Name←'TEXTFIELD'
 FIELD.Desc←'Sample text data.'
 RS.AddColumn FIELD


⍝ Add remaining fields using standard RecordSet Add... methods.
 BOOL←Boolean.New WGI.Get'TFInput'
 RS.AddNumericField'BOOLFIELD'BOOL


 DATE←DateStamp.New WGI.Get'DateInput'
 RS.AddDateField'DATEFIELD'DATE


 LIST←CharString.New WGI.Get'DropInput'
 RS.AddTextField'DROPCOMBOFIELD'LIST


⍝ Once all WizGetInputs values are retrieved we can end the Wizrd.
 W.End''


⍝ Show the new RecordSet.
 

 RS.Show''