Showing posts with label LN4. Show all posts
Showing posts with label LN4. Show all posts

Tuesday, 4 November 2008

Meta4Dummies

Sure, it works...

verifican = 0
For registros_selected = 0 to Count()-1
MoveTo(registros_selected)
If IS_SELECTED = "1" Or IS_SELECTED = 1 Then verifican = verifican + 1
Next
NUM_REG_SELECTED = Mid(verifican,0,StrIn(verifican,"."))

or
NUM_REG_SELECTED = ToString(IS_SELECTED..SysTotalItems(M4_TOTAL_SUM), 0)

Tuesday, 19 August 2008

Use of Function: DialogBox

The function DialogBox displays a message, the buttons included in the dialog are controlled by an argument.


Syntax: DialogBox(Style, Title, Body[, Body])



Style (determines the buttons displayed; one of the following macros):

  • M4_BTN_OK
  • M4_BTN_OK_CANCEL
  • M4_BTN_ABORT_RETRY_IGNORE
  • M4_BTN_YES_NO_CANCEL
  • M4_BTN_YES_NO
  • M4_BTN_RETRY_CANCEL

Return value (one of the following macros):

  • M4_OK
  • M4_CANCEL
  • M4_ABORT
  • M4_RETRY
  • M4_IGNORE
  • M4_YES
  • M4_NO

Note: For multiple language support use the function GetErrorString to identify the title and body.

Note: For execution in server, the function assumes the result M4_OK. However, make sure you use the function only in client.

Tuesday, 22 July 2008

List of LN4 Macros

LN4 macros are a series of constants that can be used in LN4 code.

Basic Macros


  • M4_TRUE

  • M4_FALSE

  • M4_SHORT_DATE_FORMAT

  • M4_LONG_DATE_FORMAT

  • M4_SUCCESS

  • M4_ERROR

  • M4_ZERO

  • M4_POSITIVE

  • M4_NEGATIVE
For Searching

  • M4_EQUAL

  • M4_DISTINCT

  • M4_GREATER

  • M4_SMALLER

  • M4_GREATER_OR_EQUAL

  • M4_SMALLER_OR_EQUAL

  • M4_EQUAL_OR_NULL

  • M4_DISTINCT_OR_NULL

  • M4_GREATER_OR_NULL

  • M4_SMALLER_OR_NULL

  • M4_GREATER_OR_EQUAL_OR_NULL

  • M4_SMALLER_OR_EQUAL_OR_NULL

  • M4_CASE_EQUAL

  • M4_CASE_DISTINCT

  • M4_CASE_GREATER

  • M4_CASE_SMALLER

  • M4_CASE_GREATER_OR_EQUAL

  • M4_CASE_SMALLER_OR_EQUAL

  • M4_CASE_EQUAL_OR_NULL

  • M4_CASE_DISTINCT_OR_NULL

  • M4_CASE_GREATER_OR_NULL

  • M4_CASE_SMALLER_OR_NULL

  • M4_CASE_GREATER_OR_EQUAL_OR_NULL

  • M4_CASE_SMALLER_OR_EQUAL_OR_NULL

  • M4_REGULAR_EXPRESSION

  • M4_REGULAR_EXPRESSION_OR_NULL

  • M4_CASE_REGULAR_EXPRESSION

  • M4_CASE_REGULAR_EXPRESSION_OR_NULL
For the Dialogue Box

  • M4_BTN_OK

  • M4_BTN _OK_CANCEL

  • M4_BTN _ABORT_RETRY_IGNORE

  • M4_BTN _YES_NO_CANCEL

  • M4_BTN _YES_NO

  • M4_BTN _RETRY_CANCEL
Push Buttons in the Dialogue Box

  • M4_OK

  • M4_CANCEL

  • M4_ABORT

  • M4_RETRY

  • M4_IGNORE

  • M4_YES

  • M4_NO
Totaling Functions

  • M4_TOTAL_COUNT

  • M4_TOTAL_SUM

  • M4_TOTAL_AVG

  • M4_TOTAL_MAX

  • M4_TOTAL_MIN

  • M4_TOTAL_FIRST

  • M4_TOTAL_LAST
Database Transaction

  • M4_COMMIT

  • M4_ROLLBACK

  • M4_ROLLBACK_RESUME (not for EndDBTransaction)

  • M4_EXECUTE_POSTVALIDATION
Strings Manipulation

  • M4_TRIM_LEFT

  • M4_TRIM_ALL

  • M4_TRIM_RIGHT

  • M4_LOWERCASE

  • M4_UNCHANGED

  • M4_UPPERCASE
Item Scope & Types

  • M4_SCOPE_ALL

  • M4_SCOPE_REGISTER

  • M4_SCOPE_BLOCK

  • M4_SCOPE_NODE

  • M4_TYPE_ALL

  • M4_TYPE_METHOD

  • M4_TYPE_PROPERTY

  • M4_TYPE_FIELD

  • M4_TYPE_CONCEPT
CHR

  • M4_NEW_LINE

  • M4_TAB

  • M4_DOUBLE_QUOTE

  • M4_CR
Attribute Indirection - Read

  • M4_ATT_SYS_SLICE_NUMBER

  • M4_ATT_SYS_START_DATE

  • M4_ATT_SYS_END_DATE

  • M4_ATT_SYS_FIRST_SLICE

  • M4_ATT_SYS_LAST_SLICE

  • M4_ATT_SYS_OLD_VALUE

  • M4_ATT_SYS_BLOB_DESCRIPTION

  • M4_ATT_SYS_BLOB_MASK

  • M4_ATT_SYS_AUX_ITEM_ID
Attribute Indirection - Execute

  • M4_ATT_SYS_ADD_NEW_SLICE

  • M4_ATT_SYS_CREATE_SLICE

  • M4_ATT_SYS_SPLIT_SLICE

  • M4_ATT_SYS_TOTALIZE_ITEMS

  • M4_ATT_SYS_TOTALIZE_SLICES

  • M4_ATT_SYS_CREATE_BLOB_FILE

  • M4_ATT_SYS_SET_BLOB_DESCRIPTION
Autoload

  • M4_AUTOLOAD_OFF

  • M4_AUTOLOAD_BLOCK

  • M4_AUTOLOAD_PRG

  • M4_AUTOLOAD_NODESAYS
Log

  • M4_ERRORLOG

  • M4_WARNINGLOG

  • M4_DEBUGINFOLOG
Sort

  • M4_ASCENDING

  • M4_DESCENDING
Send Mode Value

  • M4_SEND_NO_BRANCH

  • M4_SEND_BRANCH

  • M4_SEND_RESET
Date

  • M4_MINUS_INF

  • M4_PLUS_INF
Variant Types

  • M4_VARIANT_TYPE_NULL

  • M4_VARIANT_TYPE_NUMBER

  • M4_VARIANT_TYPE_STRING

  • M4_VARIANT_TYPE_DATE
Share Policy

  • M4_INSTANCE_NOT_SHARED

  • M4_INSTANCE_LOCAL_SHARED

  • M4_INSTANCE_GLOBAL_SHARED
DateAdd/Diff Functions

  • M4_YEAR

  • M4_MONTH

  • M4_DAY

  • M4_WEEK

  • M4_COMPLETE_WEEK

  • M4_HOUR

  • M4_MINUTE

  • M4_SECOND
Level 2 Open Mode

  • M4_OPEN_MODE_NO_LOAD

  • M4_OPEN_MODE_LOAD

  • M4_OPEN_MODE_AUTOLOAD_BLOCK

  • M4_OPEN_MODE_AUTOLOAD_PRG

  • M4_OPEN_MODE_AUTOLOAD_NODESAYS
Level 2 Organization Type

  • M4_ORGANIZATION_L2_TYPE_NONE

  • M4_ORGANIZATION_L2_TYPE_MONO

  • M4_ORGANIZATION_L2_TYPE_MULTI

  • M4_ORGANIZATION_L2_TYPE_FATHER

  • M4_ORGANIZATION_L2_TYPE_ANY
Level 2 Access Type

  • M4_CSTYPE_FRONT

  • M4_CSTYPE_BACK

  • M4_CSTYPE_BOTH

  • M4_CSTYPE_DEBUG

  • M4_CSTYPE_MAPPED
YTD Function

  • M4_KEEP_SLICES

  • M4_KEEP_RECORDS

  • M4_KEEP_ONE_RECORD
CS Timeout Functions

  • M4_DEFAULT_CS_TIMEOUT

  • M4_NEXT_CS_TIMEOUT

  • M4_GENERIC_CS_TIMEOUT

  • M4_RESET_NEXT_TIMEOUT

  • M4_ENABLE_TIMEOUT_WINDOW
Mathematical

  • M4_MATH_PI

  • M4_MATH_E
Data Language (used by DefineInstanceEx)

  • M4_LANG_LOGON

  • M4_LANG_DEVELOPMENT

Friday, 18 July 2008

Access Value of Slice by Index or Date

To read or write the value of an item with slices, you can either specify the slice directly (item[slice]; the first slice has index 0, and so on) or indicate the date as at which you want to read/write the value.

Syntax:
ItemId[slice] or
ItemId[{date}]

Example:
MY_ITEM with the following three slices
01.07.2008 to 15.07.2008: 20
16.07.2008 to 31.07.2008: 28

To identify the value of the item of the second slice use either:

  • index (starting with 0)
    x = MY_ITEM[1]
  • date (any date that falls within the period of the slice)
    x = MY_ITEM[{2008-07-16}]
    x = MY_ITEM[{2008-07-18}]
    x = MY_ITEM[{2008-07-31}]

To modify the value of the second slice use either:

  • index (starting with 0)
    MY_ITEM[1] = 29
  • date (any date that falls within the period of the slice)
    MY_ITEM[{2008-07-16}] = 29
    MY_ITEM[{2008-07-18}] = 29
    MY_ITEM[{2008-07-31}] = 29

Note: It is also possible to combine this type of access with the access by node structure index:

NodeStructureID[Index].ItemId[slice] or
NodeStructureID[Index].ItemId[{date}]

Access Values of Node Structure by Index

To identify the value of an item of a node structure, you can either position on the correct register (e.g. Begin, MoveTo, End) or use an index.

Syntax: NodeStructureID[Index].ItemId

Example:
x = MY_NODE_STRUCTURE[1].MY_ITEM

Note: The advantage of using the index is that the current position of the node structure is not modified. That means you do not need to recover the position after moving (if relevant) and the system does not need to update the position pointers (specially if the node structure you access has more nodes beneath it).