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

 

Plus8Decode$

Takes one parameter, Source

 

Plus8Encode

Takes three parameters, FieldBase, Fields, IfLenFld

 

UrlEncode$

Takes one parameter, Source

 

UrlDecode$

Takes one parameter, Source

 

Plus8Decode

Takes three parameters, FieldBase, Fields, IfLenFld

 

JsonEncode$

Has two parameters: Source, Options

 

JsonDecode$

Has two parameters: Source, Options

 

 

 

 

 

 

MOX Coding and Programing Language Syntax Documentation

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

 

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.

 

Rem / EndRem

A type of Prefix which allows the developer to separate blocks of code into organized, defined parts to help provide clarity of the logical block and add structure to the code.

 

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.

 

Home

Web/API Development Platform with an in-memory database, native-code CMS, and a powerful runtime environment Whether you are a new startup taking off or optimizing your business model for growth, Moxie.Build provides a robust platform with a proven track record for marketplaces, eCommerce, and business process automation

 

Prefix

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

 

Command Line with .mox file

A .mox file, with MOX code in it, can be run from the command line while a Moxie.Build system is not otherwise already running.

 

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.

 

AppendTable

Takes one parameter, TableName

 

TemplateType

Takes one parameter, Type

 

Parents

Takes three parameters, ChildTableName, ParentTableName, Mode

 

CopyTable

Takes four parameters, DestinationTable, SourceTable, bWithParents, bWithPWHashes

 

Delete

Takes two parameters, TableName and a boolean expression

 

Attach

Takes 3 parameters, ParentTableName, ChildTableName, IfLenFld

 

HtmlUpload

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

 

HttpCookie

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

 

HtmlJButton

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

 

HtmlSearchBox

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

 

HttpHeader

Takes two parameters, name, value

 

HttpType

Takes one parameter, Type

 

SubTemplate

Takes three parameters, Location, Mode, TemplateName

 

HttpNoCache

Has no parameters.

 

HttpsEnsure

Takes no parameters.

 

Detach

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

 

DetachWithDelete

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

 

DeleteTableProc

Takes two parameters, a TableName and ProcName

 

DeleteTableRltn

Takes two parameters, a TableName1 and TableName2

 

EmptyTable

Takes one parameter, the name of a database table

 

Get

Takes two parameters, TableName, IfLenFld

 

ListProcs

Takes one parameter, TableName

 

Flush

Takes one parameter, TableName

 

FlushAll

Has no parameters

 

NewTableRltn

Takes seven parameters, TableName, OtherTableName, ParentChild, Ratio, Note, Attr, DevNote

 

NewTableProc

Takes nine parameters, TableName, ProcName, Type, Params, GroupTypes, Label, Note, DevNote, Source

 

NewWithAttach

Takes 4 parameters, TableName, Relation, OtherTableName, IfLenFld

 

Login

Takes three parameters, Login, Password, bRememberMe

 

NewTableField

Takes six parameters, TableName, FieldName, Label, Note, Attr, DevNote

 

DeleteTable

Takes one parameter, TableName

 

DeleteTableField

Takes two parameters, a TableName and FieldName

 

New

Takes two parameters, TableName, IfLenFld

 

Lookup

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

 

Keywords$

Has one parameter.

 

JsonStream$

Has one parameter, Options

 

Parse$

Takes four parameters, Source, bAny, Search, Item

 

Path$

Takes one parameter, Index

 

RawStream$

Takes one parameter, a top query destination variable

 

RecoverMOX$

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

 

RecoverTmpl$

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

 

RecoverHtml$

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

 

RecoverHtmlObj$

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

 

LastAny$

Takes two parameters, Source, Search

 

Left$

Takes two parameters, Source, Value

 

Lang$

Takes one parameter, Source

 

Last$

Takes two parameters, Source , Search

 

Len%

Takes one parameter, a Source value

 

Login$

Takes three parameters, Login, Password, bRememberMe

 

NbSp$

Takes no parameters

 

Len$

Takes one parameter, a Source value

 

LoadFile$

Takes one parameter, PathToFile

 

Replace$

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

 

WebSafe$

Takes one parameter, Source

 

Html

Takes 3 parameters, Location, Mode, Text

 

InStrAny$

Takes two parameters, Source, Match

 

InStrAny%

Takes two parameters, Source, Match

 

HtmlAButton

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

 

HtmlButton

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

 

HtmlErr

Takes one parameter, ErrMsg

 

HtmlAlert

Takes three parameters, Location, ClassNames, AlertText

 

HtmlBlock / End HtmlBlock

Takes two parameters, Location, Mode

 

Setup$

Takes one parameter, Name

 

Sgn%

Takes one parameter, Value

 

Right$

Takes two parameters, Source, Value

 

SessionIsGroupType$

Takes one parameter, a List of possible group types

 

SSColAlpha$

Takes one parameter, Source

 

Truncate$

Takes two parameters, Source, MinLength

 

IsValidAlias$

Takes one parameter, a Source value

 

SSColNum$

Takes one parameter, Source

 

TextToHtml$

Takes one parameter, Source

 

ParentsAlias

Takes three parameters, ChildTableName, ParentTableName, Mode

 

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

 

SetIfAll

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

 

SetNew

Takes four parameters, FieldBase, FieldName, Source, IfLenFld

 

Sort

Takes two parameters, FieldBase, SortFieldList

 

SetIfAny

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

 

SetLast

Takes four parameters, FieldBase, Destination, Source, IfLenFld

 

SendEmail

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

 

Parse

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

 

ParseRecords

Takes two parameters, WorkFieldBase + FieldToParse, Delimiter

 

Num

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

 

Offset

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

 

PickFirstField

Takes three parameters, FieldBase, Destination, SourceFields

 

SaveCsvFile

Takes two parameters, FilePath, bUseHeader

 

SaveTabFile

Takes two parameters, FileName, bUseHeader

 

Pull

Takes three parameters, QueryName, FieldBase, FieldNames

 

ResetFields

Takes two parameters, FieldBase, FieldNames

 

SSReference

A command to help build spreadsheets

 

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

 

HtmlNavbar

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

 

HtmlTable

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

 

Lang

Takes four parameters, FieldBase, Destination, Source, IfLenFld

 

HtmlRaw

Takes 3 parameters, Location, Mode, bWithNoHeader

 

HtmlTab

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

 

Time

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

 

TabStream

Takes two parameters, Data, bHasHeader

 

TabStreamWS

Takes two parameters, CSVData, bNoHeaders

 

Value

Takes four parameters, FieldBase, Destination, Function, IfLenFld

 

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

 

MergeRecords

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

 

CsvStreamWS

Takes two parameters, CSVData, bNoHeaders

 

DeleteFields

Takes two parameters, FieldBase, FieldNameList

 

Build

Takes a variable number of parameters

 

CsvStream

Takes two parameters, CSVData, bNoHeaders

 

EnsureFields

Takes two parameters, FieldBase, FieldNames

 

Files

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

 

FixFields

Takes one parameter, a single character

 

EnsureNavFields

Takes two parameters, FieldBase, FieldNamesList

 

ETableStream

Takes two parameters, ExcelTableData, Options

 

UpdateTableRltn

Takes eight parameters, TableName, OldOtherTableName, NewOtherTableName, ParentChild, Ratio, Note, Attr, DevNote

 

Setup

Takes two parameters, Name, Value

 

SkipCalls

Takes no parameters

 

Search

Takes three parameters, TableName, SearchTerms, SearchInFields

 

Session

Takes two parameters, Name, Value

 

Update

Takes two parameters, TableName, IfLenFld

 

UpdateTableField

Takes seven parameters, TableName, OldFieldName, NewFieldName, Label, Note, Attr, DevNote

 

UpdateTableProc

Takes ten parameters, TableName, OldProcName, NewProcName, Type, Params, GroupTypes, Label, Note, DevNote, Source

 

UpdateOrNew

Takes two parameters, TableName, IfLenFld

 

UpdateOrNewWithAttach

Takes four parameters, TableName, Relation, OtherTableName, IfLenFld

 

Format

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

 

LoadCsvFileWS

Takes two parameters, FileName, bHasHeader

 

LoadNulFile

Takes two parameters, FileName, bHasHeader

 

ListFolders

Takes two parameters, FolderPath, bRecursive

 

LoadCsvFile

Takes two parameters, FileName, bHasHeader

 

LoadRawFile

Takes one parameter, FilePath

 

Math

Takes a variable number of parameters

 

MergeFields

Takes 4 parameters, FieldBase, Destination, SourceFields, Delimiter

 

LoadTabFile

Takes two parameters, FileName, bHasHeader

 

LoadTabFileWS

Takes two parameters, FileName, bHasHeader

 

ListFiles

Takes 3 parameters, Folder, Filter, bShowImgSize

 

Images

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

 

JsonEmbed

Has six parameters, UniqueParent, DestField, FieldBase, UniqueChild, EmbedFields, Options

 

Geo

Takes nine parameters, FieldBase, Destination, Function, Source1, Source2, Source3, Source4, Options, IfLenFld

 

Group

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

 

KeepIf

Takes 4 parameters, FieldBase, Left, Comparison, Right

 

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

 

InStr$

Takes two parameters, Source, Match

 

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.

 

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.

 

Export and Import of Database Schema

ExportSchema and ImportSchema are BuiltIn procedures that are available for use with source control systems.

 

Folder and File Structure

Brief overview on the file structure and contents under Moxie. The files and folders discussed in this post are those that are essential when upgrading to the most recent version of Moxie.Build , or when troubleshooting server errors.

 

CopyFields

Takes two parameters, DestinationFields, SourceFields

 

CopyQuery

Takes two parameters, destinationQuery, sourceQuery

 

AjaxReply

Has no parameters

 

Call

Takes a variable number of parameters

 

 

[Temp] Field

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

 

[Time] (DB Field Attribute)

Has no parameters.

 

[State] Error State

Takes one parameter.

 

[+] 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.

 

 

[Sort] (DB Relationship Attribute)

Accepts a space separated list of field names.

 

 

[FieldList]

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

 

Image

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

 

Include

Takes one parameter, ProcedureName

 

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

Takes a variable number of conditional statements

 

If (Not) / Then

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

 

JsonReply

Has no parameters

 

LangWith

Has one parameter, a Content.Lang prefix

 

IncrKillCount

Has one parameter.

 

JoinQuery

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

 

GoTo

Takes one parameter, a Label

 

[Ensure] Field Exists

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

 

FailIfRecError

Has no parameters

 

CopyUnique

Takes four parameters, DestinationQuery, SourceQuery, UniqueField, UniqueValue

 

EmailErr

Takes two parameters, SubjectPrefix, EmailBody

 

ForEach

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

 

Foreign

Takes a single parameter, a QueryName

 

File

Takes 3 parameters, Destination, Action, Source

 

Folder

Takes two parameters, FolderPath, Action

 

[SearchSort]

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

 

[Ajax]

Takes 3 parameters, Trigger, DestinationID, Path

 

[&] 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.

 

[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.

 

[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.

 

[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.

 

 

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.

 

Help with Markdown

Markdown enables simple formatting of plain text via easy to remember conventions. This page will provide you with some pointers on what formatting options are available with "Moxie Flavored Markdown".

 

Templates Documentation

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

 

 

Licensing

Moxie.Build, in short, may be used and licensed free of charge for education and non-profit organizations. Whenever it is used by government or for-profit organizations 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.

 

[Min]

Accepts a numeric value as a parameter.

 

[MText] Multiline Text Editor

Accepts one optional numeric value as a parameter

 

[MaxLen]

Accepts a numeric value as a parameter.

 

 

[Score] 0.0 to 10

Accepts 3 parameters, first is required, 2nd and 3rd are optional. A trailing optional expression after an = sign may also assign a value on the same line.

 

[SearchFieldList]

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

 

[Raw] Raw HTML

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

 

[R] Readonly

Has no parameters.

 

[Max]

Accepts a numeric value as a parameter.

 

 

[Footer] Raw HTML

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

 

[DatePicker]

Takes no parameters

 

 

[!] 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.

 

[Markdown]

Has no parameters.

 

[Header] Raw HTML

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

 

[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.

 

DnsIp$

Takes one parameter, a domain name

 

DnsName$

Takes one parameter, an IPv4 Address

 

Decrypt$

Takes two parameters, an encrypted value and the decryption key

 

Dir$

Takes one parameter, a path-mask

 

Exp10%

Has one parameter, any numeric value.

 

Exp2%

Takes one parameter, any numeric value.

 

Encrypt$

Takes two parameters, SourceValue, EncryptionKey

 

Exists$

Takes two parameters, DBTableName, DBTableRecordAlias

 

DayOfWeek$

Takes one parameter, a date

 

Cos%

Takes one parameter

 

Ctid$

Has no params

 

Chr$

Takes one parameter

 

Compress$

Compress any value/table

 

DateTime$

Takes one parameter, a string containing a date and time

 

Day$

Takes one parameter, a date

 

Cuid$

Has no params

 

DateAmPm$

Takes one parameter, a string containing a date and time

 

Hash$

Takes one parameter, a source value

 

Hex$

Takes one parameter, a source value

 

Greg$

Takes one parameter, a gregorian number

 

Guid$

Takes no parameters

 

HttpSoap$

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

 

InStr%

Takes two parameters, Source, Match

 

HtmlToText$

Takes a single parameter, Source

 

Http$

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

 

Greg%

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

 

FieldDef$

Takes one parameter, FieldName

 

FileExists$

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

 

Extract$

Takes two parameters, Source, Search

 

ExtractAny$

Takes two parameters, Source , Search

 

FolderExists$

Takes one parameter, the path of the folder

 

GeoDistance$

Takes five parameters, Lat1, Long1, Lat2, Long2, Options

 

FileSize$

Takes one parameter, a value in number of bytes.

 

FirstAlias$

Takes one parameter, TableName

 

[Pull] List of Fields from another Query

Takes three parameters, QueryName, FieldBase, FieldNames

 

Remote

Takes three parameters, Url, InputQuery, OutputQuery

 

OnError (Continue)

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

 

PaaS

Takes three parameters, Url, SaaSTenant, InputQuery, OutputQuery

 

ServerLog

Takes one parameter, ServerLogText

 

SetKillCount

Takes one parameter, Value

 

SaveHttpFile

Takes two parameters, FileName, URL

 

Select / Case / End Select

Takes a variable number of conditional statements to compare against a single source

 

NewQuery

Takes 3 parameters, QueryName, SourceQuery, bWork

 

MapQuery

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

 

Meta

Takes any unspecified data, intended for use by external systems

 

LookupQuery

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

 

Macro

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

 

[New] Field

Takes one parameter, a comma separated list of FieldNames

 

NewEComQuery

Takes one parameter, QueryName

 

Method

Private Method contained within a given procedure.

 

MsgBox

Takes two parameters, Text, Title

 

Abs%

Has one parameter, a numeric value.

 

AmPm$

Takes one parameter

 

[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.

 

[ ? ] Pick First (Top Query)

Parameter is a space separated list of fields to choose from

 

AnsiToUtf16$

Has one parameter.

 

ATn%

Takes one parameter

 

CheckPw$

Takes two parameters, User and Password

 

AnsiToUtf8$

Has one parameter.

 

ApplyLang$

Takes one parameter

 

[CountIf]

Takes one parameter, TestCondition

 

TRON

Takes one parameter, FilePath

 

TRONLog

Takes one parameter, OutputText

 

Sleep

Takes one parameter.

 

Thread

Takes a variable number of parameters

 

Moxie.cfg Config

The Moxie.cfg file is read on server start and controls aspects that cannot be changed while the server is running.

 

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.

 

Cloudflare Integration

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

 

Lookup$

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