a5wcb_jsonFormItems_from_commands Function
Syntax
C json = a5wcb_jsonFormItems_from_commands(C commands)
Arguments
- commandsCharacter
A CR-LF delimited string of commands defining the fields. Each line typically represents one field using the syntax: `Fieldname:Type`.
Returns
- jsonCharacter
The generated JSON string for the form items.
Description
Generates a JSON Form definition string from a list of shorthand commands.
Discussion
This function parses a simple text-based list of fields and converts it into the complex JSON object structure required by the JSON Form control. This is useful for quickly scripting form definitions without worrying about JSON syntax errors.
Example
dim cmds as c = <<%str% Firstname:text Lastname:text Age:number IsActive:switch %str% dim json as c json = a5wcb_jsonFormItems_from_commands(cmds) ' json now contains the full JSON array definition
See Also