Search Results for code

 

Style Guide, Procedures and Code Documentation

In order for source code to be more readily readable across teams, it is recommended that your source code always be styled according to this style guide.

 

Plus8Encode$

Takes one parameter, Source

 

JsonEncode$

Has two parameters: Source, Options

 

Plus8Decode$

Takes one parameter, Source

 

Syntax and Builtin Values, Procedures and Code Documentation

The MOX language pays heritage to BASIC, but has been crafted for the specific type of work and environment that is demanded of Moxie.Build.

 

UrlDecode$

Takes one parameter, Source

 

UrlEncode$

Takes one parameter, Source

 

Plus8Encode

Takes three parameters, FieldBase, Fields, IfLenFld

 

Plus8Decode

Takes three parameters, FieldBase, Fields, IfLenFld

 

 

 

 

 

 

Prefix

Takes a single string as parameter, which is then appended to each line in the code block.

 

Get Started with Setting up the Development Environment

Developing in Moxie.Build on localhost give you the advantage of working with the template files natively. When working on procedures (MOX code) you need to access that through the Procedures page in the Admin area of a Moxie.Build system, if running the server on localhost or on a remote server. When running on a remote server, you can edit the template files via the Files page in the Admin area.

 

Include

An Include Procedure cannot be executed directly, the contents of its source code can only be Included into other Procedures using the Include command.

 

Rem / EndRem

A type of Prefix which allows the programmer to create Remarks or Comments in their code.

 

Query Based Routing Example

For small and simple procedures that are not expected to grow in complexity over time, simple routing based on URL parameter values from a [Pull] directly from the Request query is sufficient and requires less code. For complex procedures that are expected to grow and evolve over time, a larger more robust foundation for the routing should be used.

 

HtmlUpload

Takes seven parameters, Location, Mode, Prompt, Path, Class, Name, HelpText

 

HtmlSearchBox

Takes 6 parameters, Location, Mode, ActionPath, Name, Class, Prompt

 

HtmlJButton

Takes 6 parameters, Location, Mode, ActionLabel, ActionScript, Class, Extra.

 

FolderExists$

Takes one parameter, the path of the folder

 

Html

Takes 3 parameters, Location, Mode, Text

 

Truncate$

Takes two parameters, Source, MinLength

 

Greg%

Takes one parameter, a date of the form yyyy-mm-dd

 

HtmlBlock / End HtmlBlock

Takes two parameters, Location, Mode

 

HtmlButton

Takes 6 parameters, Location, Mode, ActionLabel, ActionPath, Class, ActionMethod

 

HtmlAButton

Takes 6 parameters, Location, Mode, ActionLabel, ActionPath, Class, Extra.

 

HtmlAlert

Takes three parameters, Location, ClassNames, AlertText

 

DeleteTableField

Takes two parameters, a FieldBase and FieldNamesList

 

Detach

Takes 3 parameters, ParentTableName, ChildTableName, and a boolean expression (optional)

 

CopyTable

Takes two parameters, destinationTable, sourceTable

 

Delete

Takes two parameters, TableName and a boolean expression

 

DetachWithDelete

Takes 4 parameters, TableName, Relation, OtherTableName, and a boolean expression (optional)

 

Login

Takes three parameters, Login, Password, bRememberMe

 

Lookup

Takes six parameters, FieldBase, Destination, Table, Alias, SourceField, IfLenFld

 

EmptyTable

Takes one parameter, the name of a database table

 

Get

Takes two parameters, TableName, IfLenFld

 

HttpNoCache

Has no parameters.

 

HttpsEnsure

Takes no parameters.

 

HttpCookie

Takes 6 parameters, Name, Value, Path, Domain, Expires, Other

 

HttpHeader

Takes two parameters, name, value

 

HttpType

Takes one parameter, Type

 

AppendTable

Takes one parameter, TableName

 

Attach

Takes 3 parameters, ParentTableName, ChildTableName, IfLenFld

 

SubTemplate

Takes three parameters, Location, Mode, TemplateName

 

TemplateType

Takes one parameter, Type

 

TextToHtml$

Takes one parameter, Source

 

Left$

Takes two parameters, Source, Value

 

Len%

Takes one parameter, a Source value

 

Last$

Takes two parameters, Source , Search

 

LastAny$

Takes two parameters, Source, Search

 

NbSp$

Takes no parameters

 

Parse$

Takes four parameters, Source, bAny, Search, Item

 

Len$

Takes one parameter, a Source value

 

LoadFile$

Takes one parameter, PathToFile

 

InStrAny%

Takes two parameters, Source, Match

 

InStrAny$

Takes two parameters, Source, Match

 

InStr%

Takes two parameters, Source, Match

 

InStr$

Takes two parameters, Source, Match

 

JsonStream$

Has one parameter, Options

 

Lang$

Takes four parameters, FieldBase, Destination, Source, IfLenFld

 

IsValidAlias$

Takes one parameter, a Source value

 

HttpSoap$

Takes 8 parameters, ServerName, Port, bSecure, Path, ExtraHttpHeaders, Envelope, ExtraBody, xml

 

Right$

Takes two parameters, Source, Value

 

SessionIsGroupType$

Takes one parameter, a List of possible group types

 

Greg$

Takes one parameter, a gregorian number

 

Replace$

Takes one existing Source value, and two parameters, Search, NewVal

 

SSColAlpha$

Takes one parameter, Source

 

SSColNum$

Takes one parameter, Source

 

Setup$

Takes one parameter, Name

 

Sgn%

Takes one parameter, Value

 

RawStream$

Takes one parameter, a top query destination variable

 

Hex$

Takes one parameter, a source value

 

Http$

Takes 9 parameters, ServerName, Port, bSecure, Mode, Path, [ContentType], [extraHeader], [body], [rtnHeaders]

 

HtmlToText$

Takes a single parameter, Source

 

RecoverHtmlObj$

Takes one parameter, EscapedHTMLString, and returns the Unescaped Version of this string

 

Guid$

Takes no parameters

 

Hash$

Takes one parameter, a source value

 

RecoverHtml$

Takes one parameter, EscapedHTMLString, and returns the Unescaped Version of this string

 

New

Takes two parameters, TableName, IfLenFld

 

SetFirst

Takes four parameters, FieldBase, Destination, Source, IfLenFld

 

SetIf

Takes six parameters, FieldBase, Destination, Source, Left, Comparison, Right

 

Set

Takes four parameters, FieldBase, Destination, Source, IfLenFld

 

SetEnsure

Takes two parameters, FieldName, Value

 

SetLast

Takes four parameters, FieldBase, Destination, Source, IfLenFld

 

SetNew

Takes four parameters, FieldBase, FieldName, Source, IfLenFld

 

SetIfAll

Takes a variable number of parameters, FieldBase, Destination, Source, Test1, Test2, [etc...]

 

SetIfAny

Takes a variable number of parameters, FieldBase, Destination, Source, Test1, Test2, [etc...]

 

SendEmail

Takes 10 parameters, FieldBase, From, To, Subject, Body, bMerge, AttachName, AttachPath, Slow, IfLenFld

 

ParseRecords

Takes two parameters, WorkFieldBase + FieldToParse, Delimiter

 

PickFirstField

Takes three parameters, FieldBase, Destination, SourceFields

 

Offset

Takes 7 parameters, FieldBase, Destination, Source, OffsetVal, Operator, OpValue, IfLenFld

 

Parse

Takes seven parameters, FieldBase, Destination, Source, bAny, Delimiter, Item, IfLenFld

 

SaveCsvFile

Takes one parameter, FilePath

 

SaveJsonFile

Takes two parameters, FileName, Options

 

Pull

Takes three parameters, QueryName, FieldBase, FieldNames

 

ResetFields

Takes two parameters, FieldBase, FieldNames

 

HtmlForm

Takes 6 parameters, Location, Mode, ActionLabel, ActionPath, Class, ActionMethod

 

HtmlNav

Takes 7 parameters, Location, Mode, Title, TitleLink, Class, HtmlPre, HtmlApn

 

HtmlDTable

Takes 5 parameters, Location, Mode, Class/ID, Init, bNoAutoAlign

 

HtmlETable

Takes 6 parameters, Location, Mode, Div, Data, Script, Extra

 

HtmlTab

Takes 3 parameters, Location, Mode, bWithNoHeader

 

HtmlTable

Takes 6 parameters, Location, Mode, Class, bNoHeader, bNoAutoAlign, bNoIDTags

 

HtmlNavbar

Takes 10 parameters, Location, Mode, Title, TitleLink, Class, Fixed, bNotResponsive, bInverted, HtmlPre, HtmlApn

 

HtmlRaw

Takes 3 parameters, Location, Mode, bWithNoHeader

 

HtmlDropdown

Takes 5 parameters, Location, Mode, Title, Element, Class

 

Text

Takes six parameters, FieldBase, Destination, Function, Source, Value, IfLenFld

 

Value

Takes four parameters, FieldBase, Destination, Function, IfLenFld

 

Sort

Takes two parameters, FieldBase, SortFieldList

 

SSReference

A command to help build spreadsheets

 

GetFieldDefs

Has no parameters.

 

HtmlBlocks / End HtmlBlocks

Takes two parameters, Location, Mode

 

WithAll

Takes five parameters, FieldBase, Destination, Action, Source, IfLenFld

 

WithGroup

Takes six parameters, FieldBase, GroupByField, Destination, Action, Source, IfLenFld

 

Num

Takes 6 parameters, FieldBase, Destination, Function, Source, Value, IfLenFld

 

EnsureFields

Takes two parameters, FieldBase, FieldNames

 

EnsureNavFields

Takes two parameters, FieldBase, FieldNamesList

 

Build

Takes a variable number of parameters

 

DeleteFields

Takes two parameters, FieldBase, FieldNameList

 

FixFields

Takes one parameter, a single character

 

Format

Takes five parameters, FieldBase, FieldList, Mask, bBlanks2Zero, IfLenFld

 

ETableStream

Takes two parameters, ExcelTableData, Options

 

Files

Takes 5 parameters, FieldBase, Destination, Action, Source, IfLenFld

 

UpdateOrNewWithAttach

Takes four parameters, TableName, Relation, OtherTableName, IfLenFld

 

Search

Takes three parameters, TableName, SearchTerms, SearchInFields

 

Session

Takes two parameters, Name, Value

 

NewWithAttach

Takes 4 parameters, TableName, Relation, OtherTableName, IfLenFld

 

Parents

Takes three parameters, ChildTableName, ParentTableName, Mode

 

Update

Takes two parameters, TableName, IfLenFld

 

UpdateOrNew

Takes two parameters, TableName, IfLenFld

 

Setup

Takes two parameters, Name, Value

 

SkipCalls

Takes no parameters

 

LoadNulFile

Takes two parameters, FileName, bHasHeader

 

LoadRawFile

Takes one parameter, FilePath

 

ListFolders

Takes two parameters, FolderPath, bRecursive

 

LoadCsvFile

Takes two parameters, FileName, bHasHeader

 

MergeFields

Takes 4 parameters, FieldBase, Destination, SourceFields, Delimiter

 

MergeRecords

Takes 5 parameters, FieldBase, GroupBy, MergeField, Delimiter, bKeepBlanks

 

LoadTabFile

Takes two parameters, FileName, bHasHeader

 

Math

Takes a variable number of parameters

 

ListFiles

Takes 3 parameters, Folder, Filter, bShowImgSize

 

JsonStream

Used to manipulate a WorkQuery into a JSON type

 

KeepIf

Takes 4 parameters, FieldBase, Left, Comparison, Right

 

Group

Takes 7 parameters, FieldBase, GroupBy, GroupTotals, GrandTotals, Seperator, TotalPre, TotalPost

 

Images

Takes up to 6 parameters, FieldBase, FileName, Action, Val1, Val2, IfLenField

 

KeepIfSimilar

Takes 3 parameters, FieldBase, pOne, pTwo

 

KeepUnique

Takes one parameter, FieldName

 

KeepIfAll

Takes a variable number of parameters, FieldBase, Test1, Test2, [etc..]

 

KeepIfFound

Takes 3 parameters, FieldBase, Fields, SearchTerms

 

[Temp] Field

Parameter is a single new field name or a space separated list of new field names.

 

[+] Sum of Field of Attached Child Records

Parameter is the table and field name that you want to sum in the form of TableName.FieldName. The specified Table must be a Child of the calling Record.

 

[State] Error State

Takes one parameter.

 

[Time] (DB Field Attribute)

Has no parameters.

 

 

[FieldList]

Parameter is a space separated list of field names to be displayed.

 

 

[R] Readonly

Has no parameters.

 

[Raw] Raw HTML

Accepts one parameter which is the raw HTML content to be placed in the form at the Field's location.

 

[MText] Multiline Text Editor

Accepts one optional numeric value as a parameter

 

[Score] 0.0 to 10

Accepts 3 parameters, first is required, 2nd and 3rd are optional.

 

[Sort] (DB Field Attribute)

Used as a Relationship Attribute, the parameter is a space separated list of field names

 

[SearchSort]

Parameter is a space separated list of field names to have the display table sorted by when displaying search results.

 

[SearchFieldList]

Parameter is a space separated list of field names to be displayed when the user is viewing results from the Search List.

 

[Sort] (DB Relationship Attribute)

Accepts a space separated list of field names.

 

File

Takes 3 parameters, Destination, Action, Source

 

FailIfRecError

Has no parameters

 

[Ensure] Field Exists

Takes a variable number of parameters, a comma separated list of TopQuery variable names

 

Folder

Takes two parameters, FolderPath, Action

 

GoTo

Takes one parameter, a Label

 

Foreign

Takes a single parameter, a QueryName

 

ForEach

Takes a variable number of parameters, QueryName, MethodName, [Param1, [Param2, etc...]]

 

Public Method

A Public Method may be called from any other Procedure, by the Default plug-in, or a Custom COM DLL. Each Public Method may either use specific Input Parameters, or it may accept an Input Query.

 

Message Handler

A Message Handler is only ever called by the Database on a Database Event. These Event Messages allow a Developer to intercept operations taking place on a per-record level and implement Event based business logic.

 

 

AjaxReply

Has no parameters

 

EmailErr

The email address that will receive any run time errors that a website encounters

 

CopyQuery

Takes two parameters, destinationQuery, sourceQuery

 

CopyFields

Takes two parameters, DestinationFields, SourceFields

 

[Min]

Accepts a numeric value as a parameter.

 

 

Templates Documentation

Prerequisites: This tutorial assumes that you have already learned about Managing Files .

 

Overview for PHP Developers

This hands-on experience article is written by an experienced PHP developer, and serves as an overview to help you understand the similarities and differences.

 

[A] Copy Attached Value

Parameter must first specify only looking at Parents ( PARENT ) or only looking at Children ( CHILD ). The remainder of the parameter should be the table and field name you are after in the form of TableName.FieldName.

 

[&] Count Attached Child Records

Takes 1 Parameter which is the Table name that you want to count the Attached Records in. The specified Table must be a Child of the calling Record's Table.

 

[Ajax]

Takes 3 parameters, Trigger, DestinationID, Path

 

[AccKey] Keyboard Accelorator Key

Takes one parameter which is the keyboard key which will be used as the Access Key for a given Database Table's field.

*Note: By default, each Field's Access Key will be initialized to the first character of the Field's Label.

 

Learn More About Managing Files

Prerequisites: This tutorial assumes that you have already set up your Moxie.Build server and logged in. This page covers some of the basics that are involved in managing files and folders in the Moxie.Build system.

 

Learn More about Frontend Development

Prerequisites: This tutorial assumes that you have already set up a Category and Procedure if necessary. This page covers some of the basics that are involved in Front End development using the MOX language.

 

 

 

Licensing

Moxie.Build, in short, may be used and licensed free of charge for education, development, or non-profit organizations. Whenever it is deployed by government or for-profit organizations to a production environment the license is granted on a subscription basis.

Moxie.Build includes a number of open source components as part of its distribution; each is subject to their own licenses as included with the files for those components.

 

 

Learn More About the Content Management System

Prerequisites: This tutorial assumes that you have already set up your Moxie.Build server and logged in. This page covers some of the basics that are involved in using the Content Management aspects of the Moxie.Build system.

 

 

[!] Limited Selection List

Parameter is a comma separated list (using CSV rules and not in quotes) of the options made available to the user which are enforced on save. If the Parameter is just the single word Checkbox, then instead of a drop down list with values, the user will be given a single checkbox: If the field is unchecked the value will be blank, and if it is checked the value will be "y". When used with a Top Query in MOX, this will ensure the field value matches one of the options, if not it will throw a run time error.

 

[If] Assignment (DB Field Attribute)

Parameter is divided into two parts, the Test and the Result if True. The test comes prior to the keyword of Then and the Result if True comes after.

 

[Header] Raw HTML

Accepts one parameter which is the raw HTML content to be placed in the form, above the Field's location.

 

[Markdown]

Has no parameters.

 

 

[MaxLen]

Accepts a numeric value as a parameter.

 

[Max]

Accepts a numeric value as a parameter.

 

 

[Date] (DB Field Attribute)

Has no parameters.

 

[D] Default Value

Parameter is a value or an expression to be used when a record is created if no value is specified during the creation. The value or expression is run through the Assignment Attribute in order to calculate it's result.

 

[DatePicker]

Takes no parameters

 

[Footer] Raw HTML

Accepts one parameter which is the raw HTML content to be placed in the form, below the Field's location.

 

 

 

If (Not) / And / Or / ElseIf / End If

Takes a variable number of conditional statements

 

Cuid$

Has no params

 

Cos%

Takes one parameter

 

Compress$

Compress any value/table

 

Date$

Takes one parameter, a string containing a date

 

Day$

Takes one parameter, a date

 

DateTime$

Takes one parameter, a string containing a date and time

 

DateAmPm$

Takes one parameter, a string containing a date and time

 

AnsiToUtf8$

Has one parameter.

 

AnsiToUtf16$

Has one parameter.

 

AmPm$

Takes one parameter

 

ApplyLang$

Takes one parameter

 

Chr$

Takes one parameter

 

CheckPw$

Takes two parameters, the User Alias, and the User PW to check

 

ATn%

Takes one parameter

 

DayOfWeek$

Takes one parameter, a date

 

ExtractAny$

Takes two parameters, Source , Search

 

Extract$

Takes two parameters, Source, Search

 

Exp2%

Takes one parameter, any numeric value.

 

FieldDef$

Takes one parameter, FieldName

 

FirstAlias$

Takes one parameter, TableName

 

FileSize$

Takes one parameter, a value in number of bytes.

 

FileExists$

Takes one parameter, the path where the file is located.

 

DnsIp$

Takes one parameter, a domain name

 

Dir$

Takes one parameter, a path-mask

 

Decrypt$

Takes two parameters, an encrypted value and the decryption key

 

DnsName$

Takes one parameter, an IPv4 Address

 

Exp10%

Has one parameter, any numeric value.

 

Exists$

Takes two parameters, DBTableName, DBTableRecordAlias

 

Encrypt$

Takes two parameters, SourceValue, EncryptionKey

 

[New] Field

Takes one parameter, a comma separated list of FieldNames

 

Method

Private Method contained within a given procedure.

 

MapQuery

Takes five parameters, DestQuery, SourceQuery, SourceXFld, SourceYFld, SourceZFld

 

NewEComQuery

Takes one parameter, QueryName

 

PaaS

Takes three parameters, Url, SaaSTenant, InputQuery, OutputQuery

 

OnError (Continue)

Used as a scoping keyword, similar to WorkWith/End WorkWith .

 

NewQuery

Takes 3 parameters, QueryName, SourceQuery, bWork

 

Macro

A set of instructions that can be called with parameters to run in the current scope.

 

Include

Takes one parameter, ProcedureName

 

Image

Has 5 parameters, DestFileName, Action, SrcFileName, Val1, Val2

 

If (Not) / Then

Takes a single Field name, with an optional Not operator, followed by the conditional statement

 

IncrKillCount

Has one parameter.

 

LookupQuery

Takes six parameters, DestQuery, SourceQuery, DestDestFld, DestXFld, DestYFld, SourceYFld

 

LangWith

Has one parameter, a Content.Lang prefix

 

JoinQuery

Takes 5 parameters, DestinationQuery, SourceQuery, DestinationMatchField, SourceMatchField, Mode

 

CloudFlare Integration

CloudFlare is a first and foremost a Web Application Firewall and Content Distribution Network, among other additional services

 

TRONLog

Takes one parameter, OutputText

 

TRON

Takes one parameter, FilePath

 

Nightly Management Utility

This utility program manages a server install with one or many Moxie.Build services running by taking care of nightly tasks via a scheduled task

 

Abs%

Has one parameter, a numeric value.

 

[If] Assignment (Top Query)

Parameter is divided into two parts, the Test and the Result if True. The test comes prior to the keyword of Then and the Result if True comes after.

 

[CountIf]

Takes one parameter, TestCondition

 

Thread

Takes a variable number of parameters

 

SaveHttpFile

Takes two parameters, FileName, URL

 

Remote

Takes three parameters, Url, InputQuery, OutputQuery

 

[Pull] List of Fields from another Query

Takes three parameters, QueryName, FieldBase, FieldNames

 

ServerLog

Takes one parameter, ServerLogText

 

Sleep

Takes one parameter.

 

SetKillCount

Takes one parameter, Value

 

 

Lookup$

Takes one parameter, in the form of: Table|{Alias}|Field