Showing posts with label temenos t24 tutorial. Show all posts
Showing posts with label temenos t24 tutorial. Show all posts

Saturday, April 7, 2012

Temenos T24 Date Routines CDD

CDD

Description : Calculates the difference, in days, between two supplied dates.
Arguments : (REGION, DATE1, DATE2, DAYS)
REGION Region code
DATE1 Start date, YYYYMMDD
DATE2 End date, YYYYMMDD
DAYS 'W' to indicate working days
'C' to indicate calendar days
Returned : The number of days difference, + o r -
Continue Reading...

Friday, May 6, 2011

jBase Infobasic Command DEL

Use the DEL statement to remove a specified element of a dynamic array.

Command Syntax

DEL variable

Syntax Elements

The variable can be any previously assigned variable or matrix element. The expressions must evaluate to a numeric value or a runtime error will occur.
expression1 specifies the field in the array to operate upon and must be present.
expression2 specifies the multivalue within the field to operate upon and is an optional parameter.
expression3 is optionally present when expression2 has been included. It specifies which subvalue to delete within the specified multivalue.

Notes

Truncates non-integer values for any of the expressions to integers.

Ignores invalid numeric values for the expressions without warning.

The command operates within the scope specified, i.e. if specifying only a field then it deletes the entire field (including its multivalues and subvalues). If specifying a subvalue, then it deletes only the subvalue leaving its parent multivalue and field intact.

Examples

FOR I = 1 TO 20
Numbers<I> = I ;*//generate numbers
NEXT I
FOR I = 19 TO 1 STEP –2
DEL Numbers<I> ;*//remove odd numbers
NEXT I
Continue Reading...

Thursday, April 28, 2011

jBase Infobasic Command DEFFUN

jbase tutorial
Use the DEFFUN statement to declare an external jBASE BASIC function to the jBASE BASIC compiler and optionally define its arguments. Use DEFFUN in the program that calls the function.

Command Syntax

DEFFUN FuncName ({ {MAT} Argument1, {MAT} Argument2...})

Syntax Elements

FuncName is the name used to define the function. It must be the same as the source file name.
Argument specifies a value passed to the function by the calling program. To pass an array, the keyword you must use the MAT before the argument name. These parameters are optional (as indicated in the Command Syntax) but can be specified for clarity. Note that if the arguments are not initialized somewhere in the program you will receive a compiler warning.

Notes

The DEFFUN statement identifies a user-written function to the jBASE BASIC compiler, which must be present in each program that calls the function, before the function is called. A hidden argument is passed to the function so that a value can be returned to the calling program. The return value is set in the function using the RETURN (value) statement. If the RETURN statement specifies no value then the function returns an empty string.

Example 1

DEFFUN Add()
A = 10
B = 20
sum = Add(A, B)
PRINT sum
X = RND (42)
Y = RND(24
)
PRINT Add(X, Y)
FUNCTION Add(operand1, operand2)
result = operand1 + operand2
RETURN(result)
Call standard UNIX functions directly by declaring them with the DEFC statement according to their parameter requirements. However, they may only be called directly providing they return one of the type int or float/double or that the return type may be ignored.

Example 2

DEFC INT getpid()
CRT "Process id =":getpid()
Continue Reading...

Tuesday, April 26, 2011

jBase Infobasic Command DEFCE

With jBASE 4.1 the DEFCE statement should be used, rather than the DEFC statement, for calling external C programs, which are pure ‘C’ code and do not use the jBASE library macro’s and functions. The DEFCE statement assumes that the C functions will need to manipulate jBASE BASIC variables and hence will also require the thread data pointer. As such, all C functions require recoding to include the data pointer as an argument to the C function. The location of the data pointer argument depends upon the function return type.

Example

For C functions that do not require jBASE functions use the DEFCE statement, however the passing arguments can only be of type INT, FLOAT and STRING.
DEFCE INT MYFUNC3(INT)

INT32 MYFUNC3(INT32 Count)
{
INT32 Result;
….
return Result;
}

Example 2

#include 
#include 
#ifdef DPSTRUCT_DEF
#define JBASEDP DPSTRUCT *dp,
#else
#define JBASEDP
#endif

VAR *MyString(VAR *Result, JBASEDP VAR *VarPtr)
{
char *Ptr;
assert(dp != NULL);
Ptr = (char *) CONV_SFB(VarPtr);
printf("MyString: %s - %d\n", Ptr, strlen(Ptr) );
STORE_VBI(Result, strlen(Ptr) );
return(Result);
}
INT32 MyCalc(INT32 Value1, INT32 Value2)
{
INT32 Result;
Result = (Value1 / Value2);
printf("MyCalc: %d\n", Result);
return(Result);
}
Continue Reading...

Sunday, April 17, 2011

jBase Infobasic Function DEFC

Use the DEFC statement to declare an external C function to the jBASE BASIC compiler, define its arguments, and return types.

Command Syntax

DEFC {FuncType} FuncName ({ArgType {, ArgType ...}})

Syntax Elements

FuncType and ArgType are selected from one of INT, FLOAT or VAR. FuncType specifies the type of result that the function will return. Assumes INT if FuncType is omitted. The optional list of ArgTypes specifies the argument types that the C function will expect. The compiler must know this in advance, as it will automatically perform type conversions on these arguments.

Notes

Compile a DEFC for each C function before making any reference to it else the compiler will not recognize the function name.
The function is called in the same manner, as it would be in a C program, which means it can be used as if it was an intrinsic function of the jBASE BASIC language and therefore returns a value. However,specifying it as a standalone function call causes the compiler to generate code that ignores any returned values.
When passing jBASE BASIC variables to a C function, you must utilize the predefined macros to access the various data types it contains. C functions are particularly useful for increasing the performance of tight loops that perform specific functions. The jBASE BASIC compiler must cater for any eventuality within a loop (such as the controlling variable changing from integer to floating point). A dedicated C function can ignore such events, if they are guaranteed not to happen.
The jBASE BASIC programmer may freely ignore the type of argument used when invoking the C function, as the jBASE BASIC compiler will automatically perform type conversion.

Example 1

DEFC INT cfunc( INT, FLOAT, VAR)

Var1 = cfunc( A, 45, B)

cfunc( 34, C, J)

You can call standard UNIX functions directly by declaring them with the DEFC statement according to their parameter requirements. You can only call them directly providing they return one of the type int or float/double or that the return type may be ignored.

Example 2

DEFC INT getpid()
CRT "Process id =":getpid()
Continue Reading...

jBase Infobasic Command DEBUG

The DEBUG statement causes the executing program to enter the jBASE BASIC debugger.

Command Syntax

DEBUG

Example

IF FatalError = TRUE THEN
DEBUG ;*//enter the debugger
END
Continue Reading...

Wednesday, April 13, 2011

jBase Infobasic Command DCOUNT

The DCOUNT( ) function counts the number of field elements in a string that are separated by a specified delimiter.

Command Syntax

DCOUNT(expression1, expression2)

Syntax Elements

expression1 evaluates to a string in which fields are to be counted.
expression2 evaluates to the delimiter string used to count the fields.

Notes

The delimiter string may consist of more than one character.
If expression1 is a NULL string, the function returns a value of zero.
The delimiter string may consist of any character, including system delimiters such as field marks or value marks.

See also COUNT

Example

A = "A:B:C:D"

CRT DCOUNT(A, ":")


Output will be: 4
Continue Reading...

Thursday, April 7, 2011

jBase Infobasic Command DATE

The DATE() function returns the date in internal system form. This date is expressed as the number of days since December 31, 1967.

Command Syntax

DATE()

Notes

The system and your own programs should manipulate date fields in internal form. They can then be converted to a readable format of your choice using the OCONV( ) function and the date conversion codes.
The year 2000 is a leap year.

Example

CRT OCONV (DATE(), "D2")
displays today's date in the form: 08 JUL 64
Continue Reading...

Wednesday, April 6, 2011

jBase Infobasic Command DATA

temenos t24 tutorial
The DATA statement stacks the series of expressions on a terminal input FIFO stack. Terminal input statements will then treat this data as if entered at the keyboard.

Command Syntax

DATA expression {, expression ...}

Syntax Elements

The expression may evaluate to any data type; views each comma-separated expression as one line of terminal input.

Notes

The data stacked for input will subsequently be treated as input by any jBASE BASIC program.Therefore use it before PERFORM/EXECUTE, CHAIN or any other method of transferring program execution. Use also to stack input for the currently executing program; do not use to stack input back to an executing program.
When a jBASE BASIC program detects stacked data, it is taken as keyboard input until the stack is exhausted. The program will then revert to the terminal device for subsequent terminal input. Stacked data delimited by field marks (xFE) will be treated as a series of separate terminal inputs.

See also CLEARDATA

Example

DATA "Y", "N", "CONTINUE" ;*// stack input for prog

EXECUTE "PROGRAM1" ;*// execute the program

Continue Reading...

Sunday, April 3, 2011

jBase Infobasic Command CRT

temenos t24 tutorial
The CRT statement sends data directly to the terminal, even if a PRINTER ON statement is currently active.

Command Syntax

CRT expression {, expression..} {:}

Syntax Elements

An expression can evaluate to any data type. The CRT statement will convert the result to a string type for printing. Expressions separated by commas will be sent to the screen separated by a tab character. The CRT statement will append a newline sequence to the final expression unless it is terminated with a colon ":" character.

Notes

As the expression can be any valid expression, it may have output formatting applied to it. A jBASE BASIC program is normally executed using buffered output mode. This means that data is not flushed to the terminal screen unless a newline sequence is printed or terminal input is requested. This makes it very efficient. However you can force output to be flushed to the terminal by printing a null character CHAR (0). This has the same effect as a newline sequence but without affecting screen output.
For compatibility, use DISPLAY in place of CRT.

Example

CRT A "L#5"
CRT @ (8,20):"Shazza was here":
FOR I = 1 TO 200
CRT @ (10,10):I:CHAR (0):
...
NEXT I
Continue Reading...

Friday, April 1, 2011

jBase Infobasic Command CREATE

jbase tutorial
Use the CREATE statement after an OPENSEQ statement to create a record in a jBASE directory file or to create a UNIX or DOS file. CREATE creates the record or file if the OPENSEQ statement fails. An OPENSEQ statement for the specified file.variable must be executed before the CREATE statement to associate the pathname or record ID of the file to be created with the file.variable. If file.variable is null, the CREATE statement fails and the program enters the debugger. Use the CREATE statement when OPENSEQ cannot find a record or file to open and the next operation is to be a READSEQ or READBLK.If the first file operation is a WRITESEQ,WRITESEQ creates the record or file if it does not exist. If the record or file is created, it executes the THEN statements; if no record or file is created, it executes the ELSE statements.

Command Syntax

CREATE file.variable {THEN statements [ELSE statements] | ELSE statements}

Example

In the following example, RECORD does not yet exist. When OPENSEQ fails to open RECORD to the file variable FILE, the CREATE statement creates RECORD in the type 1 file DIRFILE and opens it to the file variable FILE.

Command Syntax

OPENSEQ 'DIRFILE', 'RECORD' TO FILE
ELSE CREATE FILE ELSE ABORT
WEOFSEQ FILE
WRITESEQ 'SOME DATA' TO FILE ELSE STOP
Continue Reading...

Monday, March 21, 2011

jBase Infobasic Command COUNTS

Use the COUNTS function to count the number of times a substring is repeated in each element of a dynamic array. The result is a new dynamic array whose elements are the counts corresponding to the elements in the dynamic array.

Command Syntax

COUNTS (dynamic.array, substring)
dynamic.array specifies the dynamic array whose elements are to be searched.
substring is an expression that evaluates to the substring to be counted. substring can be a character string, a constant, or a variable. Each character in an element is matched to substring only once.Therefore, when substring is longer than one character and a match is found, the search continues with the character following the matched substring. No part of the matched element is recounted toward another match. If substring does not appear in an element, a 0 value is returned.If substring is an empty string, the number of characters in the element is returned. If substring is null, the COUNTS function fails and the program terminates with a run-time error message. If any element in dynamic.array is null,null is returned.

Example

ARRAY="A":@VM:"AA":@SM:"AAAAA"
PRINT COUNTS (ARRAY, "A")
PRINT COUNTS(ARRAY, "AA")

Output

The output of this program is:
1]2\5
0]1\2
Continue Reading...

Tuesday, March 8, 2011

jBase Infobasic Command COS

The COS function calculates the cosine of any angle using floating point arithmetic, then rounds to the `precision implied by the jBASE BASIC program, which makes it very accurate.

Command Syntax

COS(expression)
;*// This function calculates the cosine of an expression.

Syntax Elements

The expression must evaluate to a numeric result or a runtime error will occur.

Notes

Assumes the value returned by expression is in degrees.

Example

FOR I = 1 TO 360
CRT COS(I) ;*// print cos i for 1 to 360 degrees
NEXT I
Continue Reading...

Sunday, March 6, 2011

jBase Infobasic Command CONVERT (STATEMENT)

The CONVERT statement converts one or more characters in a string to their corresponding replacement characters.

Command Syntax

CONVERT expression1 TO expression2 IN expression3

Syntax Elements

expression1 is the list of all characters to translate in expression3
expression2 is the list of characters that will be converted to.
expression3 is the string to which the conversion will apply.

Notes

There is a one to one correspondence between the characters in expression1 and expression2. That is, conversion of character 1 in expression1 to character 1 in expression2, etc.
See also: the CONVERT function.

Example

Value = 'ABCDEFGHIJ'
CRT 'Orignal: ':Value
CONVERT 'BJE' TO '^+!' IN Value
CRT 'Converted: ':Value
Orignal: ABCDEFGHIJ
Converted: A^CD!FGHI+
Continue Reading...

Monday, February 28, 2011

jBase Infobasic Command CONVERT

The CONVERT function is the function form of the CONVERT statement. It performs exactly the same function but may also operate on an expression rather than being restricted to variables.

Command Syntax

CONVERT (expression1, expression2, expression3)

Synatx Elements

expression1 is the string to which the conversion will apply.
expression2 is the list of all characters to translate in expression1.
expression3 is the list of characters that will be converted to.

NOTE: For Prime, Universe and Unidata emulations:

expression1 is the list of all characters to translate in expression1.
expression2 is the list of characters that will be converted to.
expression3 is the string to which the conversion will apply.

Example

Value = CONVERT (Value, "#.,", "$,.")

Value = CONVERT(PartCode, "abc", "ABC")

Value = CONVERT(Code, "1234567890", "0987654321")
Continue Reading...

Friday, February 25, 2011

jBase Infobasic Command CONTINUE

The CONTINUE statement is the complimentary statement to the BREAK statement without arguments.

Command Syntax

Use the statement within a loop to skip the remaining code in the current iteration and proceed directly on to the next iteration.

Notes

The compiler will issue a warning message and ignore the statement if it is found outside an iterative loop such as FOR...NEXT, LOOP...REPEAT.

Example

FOR I = 1 TO 30
IF Pattern(I) MATCHES "0N" THEN CONTINUE
GOSUB ProcessText
NEXT I
The above example will execute the loop 30 times but will only call the subroutine ProcessText when the current array element of Pattern is not a numeric value or null.
Continue Reading...

Tuesday, February 22, 2011

jBase Infobasic Command COMPARE

The COMPARE function compares two strings and returns a value indicating whether or not they are equal.

Command Syntax

COMPARE(expression1, expression2{, justification})

Syntax Elements

expression1 is the first string for comparison
expression2 is the second string for comparison
justification specifies how the strings are to be compared. "L" indicates a left justified comparison.
"R" indicates a right justified comparison. The default is left justification.
The function returns one of the following values:

-1 The first string is less than the second
0 The strings are equal
1 The first string is greater than the second

Example

A = "XY999"
B = "XY1000"
R1 = COMPARE(A,B,"L")
R2 = COMPARE(A,B,"R")
CRT R1,R2
The code above displays 1 -1, which indicates that XY999 is greater than XY1000 in a left justified comparison and XY999 is less than XY1000 in a right justified comparison.

International Mode

When using the COMPARE function in International Mode, the function will use the currently configured locale to determine the rules by which each string is considered less than or greater than the other will.
Continue Reading...

Saturday, February 19, 2011

jBase Infobasic Command COMMON

The COMMON statement declares a list of variables and matrices that can be shared among various programs. There can be many common areas including a default, unnamed common area.

Command Syntax

COMMON {/CommonName/} variable{, variable ... }

Syntax Elements

The list of variables should not have been declared or referenced previously in the program file. The compiler will detect any bad declarations and display suitable warning or error messages. If the common area declared with the statement is to be named then the first entry in the list should be a string, delimited by the / character.

Notes

The compiler will not, by default, check that variables declared in COMMON statements are initialized before they have been used as this may be beyond the scope of this single source code check. The -JCi option, when specified to the jBASE BASIC compiler, will force this check to be applied to common variables as well. The initialization of named common is controlled in the Config_EMULATE file.Variables declared without naming the common area may only be shared between the program and its subroutines (unless CHAIN is used). Variables declared in a named common area may be shared across program boundaries. When any common area is shared, all programs using it should have declared the same number of variables within it. Dimensioned arrays are declared and dimensioned within the COMMON statement.

Example

COMMON A, B(2, 6, 10), c
COMMON/Common1/ A, D, Array(10, 10)
Continue Reading...

Wednesday, February 16, 2011

jBase Infobasic Command COLLECTDATA

Use the COLLECTDATA statement to retrieve data passed from the PASSDATA clause of an EXECUTE statement.

Command Syntax

COLLECTDATA variable

Syntax Elements

variable is the name of the variable, which is to store the retrieved data.

Notes

Use the COLLECTDATA statement in any program, which is EXECUTEd (or PERFORMed) by another program where the calling program uses a PASSDATA clause. The EXECUTEd program uses a COLLECTDATA statement to retrieve the passed data. If a PASSDATA clause is not in effect, variable will be assigned a value of null.

Example

FIRST
001 EXECUTE "RUN JBASIC_PROGS SECOND" PASSDATA "Handover"

SECOND
001 COLLECTDATA PassedMessage
002 CRT PassedMessage
In the above example, program FIRST will EXECUTE program SECOND and will pass the string "Handover" in the PASSDATA clause. Program SECOND retrieves the string to a variable PassedMessage and prints the string on the Terminal screen.
Continue Reading...

Sunday, February 13, 2011

jBase Infobasic Command COL1 & COL2

Use these functions in conjunction with the FIELD function to determine the character positions 1 position before and 1 position after the location of the last field.

Command Syntax

COL1() / COL2()

Notes

When a field has been located in a string, it is sometimes useful to know its exact position within the string to manipulate either it, or the rest of the string. COL1() will return the position of the character immediately before the last field located. COL2() will return the position of the character immediately after the end of the last field located. Use them to manipulate the string.

Example

A = "A,B,C,D,E"
Fld = FIELD(A, ",", 2)
CRT COL1()
CRT COL2()
Displays the values 2 and 4
Continue Reading...
 

Blog Info

A Pakistani Website by Originative Systems

Total Pageviews

Tutorial Jinni Copyright © 2015 WoodMag is Modified by Originative Systems