george7a
30th May 2007, 11:59
Hi All,

In the last week I bumped into an undocumented function :eek:. I was interested in this issue and I will dedicate this thread for them. I am not talking about old functions/variables that are not documented in the new manuals and were documented in old ones. These kinds of functions were kept in order to support older versions. I am talking about totally undocumented functions/variables.

I have seen and old thread talking about two undocumented functions for Baan 5 (http://www.baanboard.com/baanboard/showthread.php?t=12832&highlight=Undocumented) (one of them is documented). This thread will include undocumented functions & variables for all Baan versions.

Here is a list for the undocumented functions that were posted in Baanboard:

get.message.type() was mentioned in this link (http://www.baanboard.com/baanboard/showthread.php?t=12832&highlight=Undocumented).

clipboard.to.file() function was mentioned in this link (http://www.baanboard.com/baanboard/showthread.php?t=1542). More clipboard related function here (http://www.baanboard.com/baanboard/showpost.php?p=150415&postcount=78).

fork() function was mentioned in this link (http://www.baanboard.com/baanboard/showpost.php?p=89597&postcount=3).

crypt.password$() function was mentioned in this link (http://www.baanboard.com/baanboard/showthread.php?t=10166).

If you know some more undocumented functions/variables, please share them here ;).

Best Regards,

- George

spartacus
30th May 2007, 14:51
I think "free$" has also to be mentioned. It is discussed here:
http://www.baanboard.com/baanboard/showthread.php?t=5687&highlight=free%24

george7a
4th June 2007, 09:02
I would like to share that this all began when I found a function in Baan IV by "luck". I searched for it in the IV & V manuals but I did not find it. After a while I searched in the LN manual and there it was! So it was not a totally undocumented function after all.

However, I believe there are other undocumented functions/variables out there. I will make this thread a sticky one (for a while) so that others can contribute.

- George

Hitesh Shah
8th June 2007, 10:05
I checked in the documentation . I think this also is an internal variable which stores current company name .

george7a
23rd July 2007, 13:57
single.occ.objects was mentioned in this post (http://www.baanboard.com/baanboard/showpost.php?p=96040&postcount=8). As I have noticed, it is used to hold the ID number of each object used in the session.

george7a
25th July 2007, 08:46
I checked in the documentation . I think this also is an internal variable which stores current company name .

I have found that the attr.company$ is an extern string defined in ottstp_stddll & ottstpstandard DLLs.

Edit: This was found on Baan IV

Hitesh Shah
25th July 2007, 16:55
True . In fact this variable could be available in any program only if it's delcared in any of these programs . In fact all Baan 4GL programs are extensions of ottstpstandard which contains the Baan standard program logic .

In fact u can extend this logic for other function prototypes and other variables also .

george7a
30th July 2007, 12:15
In the manuals of Baan IV/V pstat function (http://www.baanboard.com/programmers_manual_baanerp_help_functions_processes_pstat) is not fully documented. There are some macros that can retrieve information from pstats's output. Only the first three macros (ps.state, ps.group & ps.parent) are documented. I have luckily found other macros that do work on Baan IV.

Here is the full list:

ps.state(info) | returns PSRUNNING, PSBLOCKING, PSSLEEPING, or PSTERMINATING.

ps.group(info) | returns the identifier of the process group to which the process belongs.

ps.parent(info) | returns the identifier of the parent process of the process group.

ps.nice(info) | returns the nice value of the process.

ps.cpu.use(info) | returns the number of ticks used by the process.

ps.mwin(info) | returns the object id of the main window of the process.

ps.pri(info) | returns the priority of the process.

ps.size(info) | returns the amount of memory allocated by the process (in bytes).

ps.cwin(info) | returns the object id of the current window of the process

After that, I checked in the LN manuals and the function was fully documented (with all the macros)! I thought I will post the full documentation here so others can see those undocumented macros also in Baan IV & V.

- George

NPRao
31st July 2007, 20:22
More inf on SWITCH.TO.PROCESS How to Combine two session in a one form (http://www.baanboard.com/baanboard/showthread.php?t=25379&highlight=switch.to.process)

george7a
10th August 2007, 08:16
I have ran through this function on our Baan IV! It takes the following arguments:

long = oipstat (long,long,string)

It reminds me of pstat() function. However I did not find it in any documentation and I don't know what it does! :confused:

Maybe someone else knows!

Edit:
The documentation for this function can be found here (http://www.baanboard.com/baanboard/showpost.php?p=136188&postcount=67)

- George

george7a
11th September 2007, 13:46
get.cust.code takes no arguments and returns the Baan Customer Code as a string.

P.S. found in Baan IV

george7a
11th September 2007, 14:06
get.lic.no takes no arguments and return the Baan License Number as long

george7a
12th September 2007, 09:28
is.password.ok takes two strings and returns true if there is a match between the password and the encrypted one (review crypt.password$ function in this thread). After I found it, I saw it was mentioned in the following links:
http://www.baanboard.com/baanboard/showthread.php?t=26579&highlight=is.password.ok
http://www.baanboard.com/baanboard/showthread.php?t=28143&highlight=is.password.ok

- George

george7a
25th September 2007, 12:19
As I understand load.font() should load a font into a variable that will be used in setting the font for the chart manager

It was mentioned:
http://www.baanboard.com/baanboard/showthread.php?t=14647&highlight=load.font

It was also mentioned in the Twiki but not documented:
http://www.baanboard.com/programmers_manual_baanerp_help_functions_structure_chart_manager_set_tree_font

george7a
25th September 2007, 12:30
Subdal has its own thread here: http://www.baanboard.com/baanboard/showthread.php?t=929

george7a
25th September 2007, 12:47
It is an extern function in ttdllhypertext and it should read the question's description of the question code arg. It was mentioned in the following links:
http://www.baanboard.com/baanboard/showthread.php?t=9460
http://www.baanboard.com/baanboard/showthread.php?t=8324

günther
25th September 2007, 13:27
Some people were looking for that function, but it's not available on Baan IV.

Today, I found out that you can simply use tt.field.desc() to retrieve labels! You just have to use the correct label name to make it work - the first two characters of the label name must be the module.

Example: Label "tibom010.exin" is defined in language "2" and module "ti". To retrieve it, use

string desc(80)
tt.field.desc("tibom010.exin", desc)
message("desc: %s", desc) | will give "desc: extra information"

P.S. It is documented in Baan ERP but not in IV

Hitesh Shah
25th September 2007, 15:09
Function save.rcd.main and restore.rcd.main are used to save and restore main table buffer of an occurrence and are useful when table buffer values are lost for an occurrence e.g. when user changes the form .

Restore.rcd.main() is documented but not save.rcd.main() in Baan IV.

Original reference on Baan http://www.baanboard.com/baanboard/showthread.php?t=25871&highlight=save.rcd.main
http://www.baanboard.com/baanboard/showthread.php?t=15298&highlight=save.rcd.main

george7a
25th September 2007, 15:53
This function is used to handle the message "transaction is on, can't continue"

Original reference:
http://www.baanboard.com/baanboard/showthread.php?t=22640

george7a
25th September 2007, 16:10
This undocumented variable is used to select the preview option in the "Select Device" session

Original reference:
http://www.baanboard.com/baanboard/showthread.php?t=7016

Hitesh Shah
27th September 2007, 06:42
Main.table$ is bound to a session after before.program section is executed . So if one has wants to have different main table based on context for a different company , it can be done by switch.to.company and main.table$ assignment in before.program section . Main.table$ or main table company can not be changed in any other sections .

Original reference where display sessions on tools tables have been created .
http://www.baanboard.com/baanboard/showthread.php?t=16215&highlight=main.table%24

Hitesh Shah
29th September 2007, 08:34
If one wants to use ttstpcalender in a non-date container , ttstpcalender can be used along with its return value in a variable g.value .

Original reference for this functionality .

http://www.baanboard.com/baanboard/showthread.php?t=9778&highlight=ttstpcalender

BaanInOhio
29th September 2007, 16:48
The documentation for 'run.prog' states that there is an 'arguments' variable available, but doesn't state how to pass multiple arguments to a UNIX shell script.

To do so, build a string with each varlable within single quotes and a space within each. This will allow activating a script that accepts $1, $2, and $3 as inputs (the beginning and end of this string is a single quote between double quotes):

script.args = "'" & strip$(param1) & "' '" & strip$(param2) & "' '" & strip$(param3) & "'"
ret = run.prog(unixscript, script.args, RP_NOWAIT)


The unix script would contain something like:

/usr/local/bin/mpack -s "$1" $2 $3


The passed agrument string would look like:

'subject here' 'mailfile.txt' 'me@mine.com'

Hitesh Shah
1st October 2007, 06:33
In my Baan IV these functions are still not documented . Hence linking here the original reference to these functions here .

http://www.baanboard.com/baanboard/showthread.php?t=1181&highlight=run.baan.prog

http://www.baanboard.com/baanboard/showthread.php?t=1885&highlight=run.baan.prog

Hitesh Shah
1st October 2007, 06:36
All these fields are initialized by the standard program for a field in all field sections .

attr.type contains the field data type like db.date , db.string etc
attr.domain$ contains the domain of the field.
attr.adju contains string to indicate the field adjustment whether right "r" , left "l" or none "n" .
attr.conv contains the case conversions string whether upper "u", or lower "l" or none "n".

If same functions are used for many fields of different type, these variables may be of use depending on functionality requirement.

Also if one wants to enter fields of different kind in a single container of string type , then also these variables can be of use .

Attr.type has been discussed earlier in
http://www.baanboard.com/baanboard/showthread.php?t=12663&page=2&highlight=attr.type

attr.adju is documented in Baan IV later versions as having deprecated . But is still used in Baan IV.

george7a
1st October 2007, 15:57
query.extend.order() is used to set your order in the query extention. Original references:
http://www.baanboard.com/baanboard/showthread.php?t=7699
http://www.baanboard.com/baanboard/showthread.php?t=1156

Hitesh Shah
4th October 2007, 06:35
This is an excellent function found in standard program which shows the enum / set options on a field when called in before.zoom section of a field .

function extern long get_enum_value(
const string dom_name(),
long type,
ref string descr())

where dom_name = set or enum domain
type = db.enum or db.bitset
descr - enum description

Return value is the database value of the selection .


If it is called before.zoom section of string field with appropriate arguments , attr.zoomcode is set to 0 in same section , it can give the impact of enum/set entry just like standard program .

One can use rdi functions like RDI.COLUMN, RDI.DOMAIN , RDI.DOMAIN.ENUM ,RDI.DOMAIN.ENUM.VALUE , RDI.DOMAIN.SET, RDI.DOMAIN.SET.VALUE along with enum functions like etol() ,ltoe() and enum.descr$() in important field sections (like beore.display , before.input , after.input , when.field.changes etc ) to get a same feeling of entering data in enum field itself and storing the same in backend database consistently .

george7a
5th October 2007, 12:18
This function is used so that two variables in different processes will use the same memory area. Original reference:
http://www.baanboard.com/baanboard/showthread.php?t=13526

Hitesh Shah
6th October 2007, 07:12
free$ and procesinfo$ variables are pre-defined string variables of size 50 and 200 repectively. This is partially documented .

free$ is single memory location with baan which remains uniform across all program (may be at.base function used in standard program) . So if u change value of free$ , its available in any program of that bshell without any import/export/ get.var/put.var .

On the other hand procesinfo$ is a variable for each program instance and it gets initialized with the value of procesinfo when linking a session to menu . This can also be used in inter process communication through import /export / get.var/put.var .

So procesinfo$ variable can be used as input variable in a standard session and used in a report (becasue this variable is separate for each program) whereas free$ should not be used because its value can affect other programs using free$ . free$ can be used in inter-process communication whereby free$ is set back to "" on finish of the process

Hitesh Shah
8th October 2007, 06:32
When creating an SQL string for a dynamic query its very important to use and an index to avoid the full table scan and to get better query speed . In order to use an index , its very important to know the elements of an index of a table and its relevance for the sql on hand .

Normally one can scan ttadv420/1/2/3 tables to get the elements of a table index . Besides being complex , it also may differ from runtime dd at times . There is an easier route to get these element . table indices are combined colums of the table also . And one can use rdi.column.combined function to get the index elements as child columns. It may be possible that these child column too may be combined column (like 1st index of tdsls041 in Baan IV ) . In such a case , one needs to use rdi.column.combined function again on such combined fields.

Now rdi.column.combined is a well documented function in Baan along with other excellent rdi functions.

george7a
11th October 2007, 14:38
The following are undocumented functions in Baan IV. I still do not have any info on them.

dump.screen
pty.ok
key.to.option
jump.retry.point
retry.point
retry.level
sync.display.server
rdi.vrc.path
rdi.option.short
free.font
text.extends
change.display
Maybe someone else does!

- George

Hitesh Shah
11th October 2007, 15:16
Interoperability is the flavour of the season. Creating an interoperable scaleable xml data list which can be opened in any office spreadsheets is as easy as creating flat sequential file . Baan XML functions documented in a progguide.chm available in Baan support site. There are lot of XML samples on the board . However all the samples lead to do in-memory XML generation and parsing which is very resource intensive .

With the help of XML functions ( available in Baan XML guide ), here is the sample xml code written in Baan 4GL to create XML data lists from tccom020 without blocking substantial memory.
|******************************************************************************
|* tijwxxmltest 0 VRC B40c c4 cust
|* XML Test
|* hitesh create test.xml data list
|* 23-11-03 [16:36]
|******************************************************************************
|* Script Type: 0
|******************************************************************************

table ttccom020
|****************************** DECLARATION SECTION ***************************
|****************************** PROGRAM SECTION ***************************
|****************************** ZOOM FROM SECTION ***************************
|****************************** FORM SECTION ***************************
|****************************** CHOICE SECTION ***************************
|****************************** FIELD SECTION ***************************
|****************************** MAIN TABLE SECTION ***************************
|****************************** FUNCTION SECTION ***************************

function main()
{
long mainid,rowid
long ret
long fh
domain tcmcs.str80 text
domain tcmcs.str80 error.msg
string xmlstr(1000)
|* write
fh = seq.open("test.xml","w")
mainid = xmlNewNode("Supplier",XML_ELEMENT)
ret=xmlWritePrettytostring(xmlstr,mainid,mainid)
xmlstr = xmlstr(1;len(xmlstr)-3) & ">" & chr$(10)
if seq.puts(xmlstr,fh) then
message("Error writing file")
endif
rowid = xmlNewNode("Row",XML_ELEMENT)
select tccom020.*
from tccom020
selectdo
xmlRewriteDataElement(rowid, "SupplierCode", tccom020.suno )
xmlRewriteDataElement(rowid, "Name", tccom020.nama)
xmlRewriteDataElement(rowid, "Name2", tccom020.namb)
xmlRewriteDataElement(rowid, "Address", tccom020.namc)
xmlRewriteDataElement(rowid, "Address2", tccom020.namd)
xmlstr = ""
ret=xmlWritePrettytostring(xmlstr,rowid,rowid)
if seq.puts(xmlstr(23),fh) then
message("Error writing file")
endif
endselect
if seq.puts("</Supplier>",fh) then
message("Error writing file")
endif
seq.close(fh)
ret = xmlDelete(mainid)
ret = xmldelete(rowid)
}


The file text.xml can be opened in any office spreadsheet (including Excel) which can parse XML data files.

Probably there is still better and elegant way to create an XML file without taking the complete document in memory. At this moment its not known to me.

george7a
12th October 2007, 10:32
This function takes the process ID number and a new "nice value" (or basis priority). It changes the process's nice value to the new given value.
-20: High
0: Normal
20: Low

george7a
12th October 2007, 11:20
This function opens a window with a text filed & a label. You can write you question in the label and get the answer that the user types in the text box.

This function is found in ottdllinputstr.

function extern long input.string(
string mwindow.title(80) mb,
string label(80) mb,
long p.width,
long f.width,
ref string pattern() mb )

This function starts a main window with given title.
This window contains:
- a label, indicating the string to be asked for
- an input field with given width (p.width) and number
of visible characters (f.width)
- two buttons (OK and Cancel)
The string value of the input field will be stored in pattern argument

Pre: only to be used in graphical environments
Ret: true: succes, pattern will be filled
false: error, action canceled

Example

#pragma used dll ottdllinputstr
|...
|..
|.

input.string("My Window Title","How old are you?",30,30,s1)

message(s1) | The result will be in s1

It was also mentioned here:
http://www.baanboard.com/baanboard/showthread.php?t=22689

george7a
16th October 2007, 12:20
Here is another list of some undocumented functions that there is no info on them yet:

open.display
destroy.gc
current.menu
current.bar
change.menu
change.bar
pty.write
pty.winsize.ok
pty.winsize
cursor.off
cursor.on
obj_in_core
send.signal
oipstat
option.to.key
fsum
seq.r.long
seq.w.long

Hitesh Shah
19th October 2007, 07:53
Excellent functions found in ttdllextint about table , table field , label , sessions , menu , domains , indices which can also be called from any OLE application . Get.combined.fields is more elegant way to find index element than rdi.column.combined .

---------------------------GENERAL INFO---------------------------------
Object = ottdllextint
Pathname = /b4c4appl/bse/tools/ttB40_c4/ottdll/odllextint

---------------------------OBJECT HEADER--------------------------------
Magic = [_bic_dll_]
relno = 61
obj_revision = 1
object_flags = 8=DLL

---------------------------DLL PROTOTYPES-------------------------------
function extern long baan.format(
domain ttadv.type field.datatype,
const string difo(),
long digb,
long diga )

Desc: get display-length of field having a display-format
Pars: field.datatype: domain-type of bic_global
difo: display-format
digb: digits before
diga: digits after
Returns: max-length of formatted field

function extern long change.duplicatefielddescriptions(
ref long nr.of.fields,
ref string fields(,) fixed,
ref domain ttcdes field.descriptions() fixed mb )

function extern long get.combined.fields(
const string combi.fld(),
ref string simple.flds() )

Desc: get fields in combined fields
also combined fields in combined fields are converted to
simple fields
Par : combi.fld : combined field
simple.flds (output) : simple fields, each field takes 18 chars,
padded with space
Returns: nr of simple fields in combined fields

function extern long get.domain.info2(
const string cdom(),
ref domain ttadv.type datatype,
ref long is.checkbox,
ref domain ttadv.difo difo,
ref long digb,
ref long diga,
ref long leng,
ref long difoleng,
ref long enum.cnst )

Desc: get properties of domain
depending on the datatype the properties are relevant
Par : cdom : domain (including package code)
datatype (output) : datatype, when datatype=0, domain not found
is.checkbox (output) : shown as checkbox (enum)
difo (output) : display format (all)
digb (output) : digits before comma (integer,long,byte,
double,float)
diga (output) : digits after comma (double,float)
leng (output) : length (date,utc,string,mb-string,text,enum)
difoleng (output) : length in case a display-format is specified
is.segmented (output) : 1 is segmented field (string)
-1 normal field
enum.ccnst (output) : number of enum constants for this domain
Returns: -

function extern long get.domain.vrc(
domain ttadv.cpac cpac,
domain ttadv.cdom cdom,
long including.tt,
ref domain ttadv.vers vers,
ref domain ttadv.rele rele,
ref domain ttadv.cust cust,
ref domain ttdesc60 desc mb )

Desc: get domain properties given current VRC of user
Par : cpac : package code domain
cdom : domain code
including.tt : get tt-objects even when not in package comb
vers (output) : version
rele (output) : release
cust (output) : customer
desc (output) : description
Returns: 0 when domain found
-1 when not found

function extern long get.index.fields(
domain ttadv.cpac cpac,
domain ttadv.cmod cmod,
domain ttadv.flno flno,
domain ttadv.vers vers,
domain ttadv.rele rele,
domain ttadv.cust cust,
ref string simple.flds() )

Desc: get fields in first index
also combined fields in combined fields are converted to simple fields
Par : cpac : package code table
cmod : module code
flno : table name
vers : version code
rele : release code
cust : customer code
simple.flds (output) : simple fields, each field (max. 32) takes 18 chars,
padded with space
Returns: nr of simple fields in first index
0 : no index found

function extern long get.label(
const string clan(),
const string cpac(),
const string clab(),
ref domain ttcdes desc mb,
ref domain ttadv.llen llength,
ref domain ttadv.lhgt lheight,
long dynamic,
long including.tt )

Desc: get label description, when no label found with specified
length and height, the best fit label will be retrieved
Par : clan : language code
cpac : package code label
clab : label code
desc (output) : description
llength (input) : max length of label to search for
: -1 means search for longest label
(output) : length of found label
lheight (input) : max height of label to search for
(output) : height of found label
: -1 means search for highest label
dynamic (input) : get longer/higher label when no label
found with specified length/height
including.tt (input) :

Returns: 0 when label found
-1 when label not found
-2 no package integration

function extern long get.menu.vrc(
domain ttaad.clan clan,
domain ttadv.cpac cpac,
domain ttadv.cmod cmod,
domain ttadv.cmen cmen,
domain ttadv.parm parm,
long including.tt,
ref domain ttadv.vers vers,
ref domain ttadv.rele rele,
ref domain ttadv.cust cust )

Desc: get menu key-properties given current VRC of user
Par : clan : language code
cpac : package menu
cmod : module menu
cmen : menu code
parm : parallel menu id
including.tt : get tt-objects even when not in package comb
vers (output) : version
rele (output) : release
cust (output) : customer
Returns: 0 when menu found
-1 when not found

function extern long get.session.vrc(
domain ttadv.cpac cpac,
domain ttadv.cmod cmod,
domain ttadv.cses cses,
long including.tt,
ref domain ttadv.vers vers,
ref domain ttadv.rele rele,
ref domain ttadv.cust cust,
ref domain ttadv.cpac mpac,
ref domain ttadv.cmod mmod,
ref domain ttadv.flno mfln,
ref domain ttadv.kses kses,
ref domain ttadv.cmod cmop,
ref domain ttadv.cprs cprs )

function extern long get.table.vrc(
domain ttadv.cpac cpac,
domain ttadv.cmod cmod,
domain ttadv.flno flno,
long including.tt,
ref domain ttadv.vers vers,
ref domain ttadv.rele rele,
ref domain ttadv.cust cust )

Desc: get table key-properties given current VRC of user
Par : cpac : package code table
cmod : module code
flno : table name
including.tt : get tt-objects even when not in package comb
vers (output) : version
rele (output) : release
cust (output) : customer
Returns: 0 when table found
-1 when not found

function extern long get.tablefield.info(
domain ttadv.cpac cpac,
domain ttadv.cmod cmod,
domain ttadv.flno flno,
domain ttadv.vers vers,
domain ttadv.rele rele,
domain ttadv.cust cust,
domain ttadv.fdnm fdnm,
ref domain ttadv.cpac pacd,
ref domain ttadv.cdom cdom,
ref domain ttyeno mand,
ref domain ttadv.clab clab,
ref domain ttadv.cpac rfpa,
ref domain ttadv.dept dept,
ref domain ttyeno acti,
ref domain ttyeno comb,
ref domain ttadv.expr defa mb )

Desc: get properties of table-field
Par : cpac - package code
cmod - module code
flno - tablename
vers - version
rele - release
cust - customer
fdnm - fieldname
pacd (output) - package code domain
cdom (output) - domaincode
mand (output) - mandatory field
clab (output) - label code
rfpa (output) - package of ref-table (if empty no ref-table)
dept (output) - nr of array-elements (depth) of field
acti (output) - active?
comb (output) - combined field?
defa (output) - default expression
Returns: 0 when field found
-1 when not found

function extern long new.read.session.fields(
const string session(),
const domain ttaad.clan clan,
long runtime,
ref long nr.of.fields,
ref string fields(,) fixed,
ref domain ttcdes field.descriptions() fixed mb,
ref long field.is.index(),
ref long field.is.mandatory(),
ref string field.domains(,) fixed,
ref domain ttadv.expr field.defaults() fixed mb,
ref long field.field.type(),
ref long field.depth(),
ref long field.noelemonform(),
ref domain ttadv.typf field.write(),
ref domain ttadv.type field.data.type(),
ref long field.length(),
ref long field.in.primary.index(),
ref long field.view.field(),
ref string main.table(),
ref string session.description(),
ref domain ttadv.ftyp form.type )

function extern long package.integration(
domain ttadv.cpac cpac,
long including.tt )

function extern long read.session.fields(
const string session(),
const domain ttaad.clan clan,
ref long nr.of.fields,
ref string fields(,) fixed,
ref domain ttcdes field.descriptions() fixed mb,
ref long field.is.index(),
ref long field.is.mandatory(),
ref string field.domains(,) fixed,
ref domain ttadv.expr field.defaults() fixed mb )

Desc: get form-fields of session based on package combination
label-only fields are not returned
this function is used by DEM
Par : session (input) : name of session (<package><module><session>)
clan (input) : language of form, labels
nr.of.fields (output) : number of fields
fields() (output) : names of fields, <fieldname>[(<element-nr>]
(when elementnr ommitted, element 1 assumed)
field.descriptions() (output) : (label) descriptions of fields, based on details session
field.is.index() (output) : field is part of one of the active indices
field.is.mandatory() (output): field is mandatory
field.domains() (output) : names of domains
field.defaults() (output) : default (expressions)
Returns : -1 : The specified session could not be found
-2 : The forms belonging to the specified session could not be found
0 : The session could be found


PS - Functions require current company to be 0 . However function new.read.session.fields still gives some null pointer error when trying to use . Function read.session.fields works nice . So needs more testing for successfully using it or else use the time tested versatile rdi functions .

george7a
23rd October 2007, 13:38
"time" is an undocumented predefined variable with the following foramt:
time R current system time; format HHMM
Original reference:
http://www.baanboard.com/baanboard/showthread.php?t=8265

george7a
23rd October 2007, 14:00
read.ques.desc was mentioned in the following links:
http://www.baanboard.com/baanboard/showthread.php?t=9460
http://www.baanboard.com/baanboard/showthread.php?t=8324

It is used to get the text of a Question.

function extern long read.ques.desc(
string arg(40),
ref string desc(),
[ domain ttaad.clan clan ],
[ long develop ] )

Read question description of the question code arg

pre : arg is the questioncode in the format of ppqqqqqqqqqqqqq
clan is optional, default language$
develop is optional
false: read description in runtime VRC tree. [default]
true : read description in development VRC tree (ttadv040)
post: true - desc filled with question description
false - desc is empty

Here are all the other functions in that DLL

This DLL provides a function to convert a hypertextcode to a
description. It also provides some common functions to read
description. of software components.

Following function are available:
- function bool make.hypertext.desc(arg, desc, [ clan , develop ] )
- function bool make.topic.desc(type, clan, arg, desc, develop)
- function check.integration(cpac cpac, develop)
- function bool read.impl.func.desc(arg, desc, [ clan, develop ])
- function bool read.subf.desc(arg, desc, [ clan, develop ])
- function bool read.relation.desc(arg, desc, diagram, [ clan, develop ])
- function bool read.session.desc(arg, desc, [ clan, develop ])
- function bool read.form.desc(arg, desc, [ clan, develop ])
- function bool read.table.description(arg, desc, [ clan, develop ] )
- function bool read.table.field.description(arg, desc, [ clan, develop ])
- function bool read.formfield.description(arg, desc, [ clan, develop ])
- function bool read.label.desc(arg, desc, [ clan, develop ] )
- function bool read.message.desc(arg, desc, [ clan , develop ])
- function bool read.ques.desc(arg, desc, [ clan , develop ])
- function bool read.enum.desc(arg, desc, [ clan, develop ])
- function bool read.menu.desc(arg, desc, [ clan , develop ])
- function bool read.report.desc(arg, desc, [ clan, develop ])
- function bool read.helptextcode.desc(arg, desc, [ clan, develop ])
_ function bool read.choice.option.description(arg, desc, [ clan, develop ])


|---------------------------DLL PROTOTYPES-------------------------------
function extern long check.integration(
domain ttadv.cpac cpac,
long develop )

This functions checks if the package has integration with the package
combination.
pre: cpac filled with package code
develop: false check on runtime
true - check on development

post: Record ttadv111 will be filled with the right VRC tree.

function extern convert.hypertext.line(
domain ttdesc215 text.line mb,
long length,
ref domain ttdesc215 new.line mb,
ref domain ttdesc215 rest.line mb,
[ domain ttaad.clan clan ],
[ long develop ] )

This function scans a line of text. If the line contains
one or more hypertext codes, these will be converted
to descriptions using function make.hypertext.desc.

clan: optional language code [default current language]
develop: false - Search description in runtime VRC tree [default]
true - Search description in development VRC tree (ttadv040)

Pre: not isspace(text.line)
length of new.line >= length
Post: line may be longer when hypertext code has been converted
rest is stored in variable rest.line
rest.line may be longer than length

function extern long convert.hypertext.text(
long textno,
domain ttaad.clan lang,
ref string target.file(),
[ long develop ],
[ long length ] )

This function reads a text in a given text number and language code
Each line will be checked by the function
convert.hypertext.line whether hypertext codes are
available. The converted text will be stored in the
target.file

develop: false - Search description in runtime VRC tree [default]
true - Search description in development VRC tree (ttadv040)
length : the maximum length of a text line, default the line length
of the text group

Pre: text number available in given language
Post: new text may be greater than original text

Ret: the number of lines of the new text will be returned
return -1 if an error occurs

function extern long is.topic(
ref string arg(),
ref string code(),
ref long only.desc,
ref long end.posi )


function extern long make.hypertext.desc(
string arg(320) mb,
ref string desc() mb,
[ domain ttaad.clan clan ],
[ long develop ] )

Function to convert a hypertext code to a description.

pre: hypertextcode is in the format <KEYWORD><code>
clan: optional language code [default current language]
develop: false - Search description in runtime VRC tree [default]
true - Search description in development VRC tree (ttadv040)

post: false : hypertext not found
true : hypertext found and description filled

function extern long make.topic.desc(
long type,
domain ttaad.clan clan,
ref string arg(),
ref string desc(),
long develop )

This function converts the hypertextcode to a description. This function is the same
as function make.hypertext.desc() except the type of the hypertextcode should be known.

pre: type: The type of the hypertextcode.
clan: language code
arg : The code of the hypertext.
develop: false - Search description in runtime VRC tree
true - Search description in development VRC tree

post: false : hypertext not found
true : hypertext found and description filled

function extern long read.choice.option.description(
string arg(40),
ref string desc(),
[ domain ttaad.clan clan ],
[ long develop ] )

Read description choice option (Standard option or user defined option)

pre : arg is the choice option code in the format of start.set or
formcode.user.0
clan is optional, default language$
develop is optional
false: read description in runtime VRC tree. [default]
true : read description in development VRC tree (ttadv040)
post: true - desc filled with option description
false - desc is empty

function extern long read.enum.desc(
string arg(40),
ref string desc(),
[ domain ttaad.clan clan ],
[ long develop ] )

Read enum description of the enum code arg

pre : arg is the enum code in the format of ppmmmqqqqqqqqqqqq
clan is optional, default language$
develop is optional
false: read description in runtime VRC tree. [default]
true : read description in development VRC tree (ttadv040)
post: true - desc filled with enum description
false - desc is empty

function extern long read.form.desc(
string arg(40),
ref string desc(),
[ domain ttaad.clan clan ],
[ long develop ] )

Read form description of the form code arg

pre : arg is the form code in the format of ppmmmfffffffff
clan is optional, default language$
develop is optional
false: read description in runtime VRC tree. [default]
true : read description in development VRC tree (ttadv040)
post: true - desc filled with session description
false - desc is empty

function extern long read.formfield.description(
string arg(40),
ref string desc(),
[ domain ttaad.clan clan ],
[ long develop ] )

Read formfield description of the formfield code arg

pre : arg is the session code in the format of ppmmmfffffffff.fffff
clan is optional, default language$
develop is optional
false: read description in runtime VRC tree. [default]
true : read description in development VRC tree (ttadv040)
post: true - desc filled with formfield description
false - desc is empty

function extern long read.helptextcode.desc(
string arg(40),
ref string desc(),
[ domain ttaad.clan clan ],
[ long develop ] )

Read search argument of helptextcode arg

pre : arg is the helptextcode code in the format of pphhhhhhhhhhhhhhhhhhhhhhhhhhhh..
clan is optional, default language$
develop is optional
false: read description in runtime VRC tree. [default]
true : read description in development VRC tree (ttadv040)
post: true - desc filled with search argument of helptextcode description
false - desc is empty

function extern long read.impl.func.desc(
string arg(40),
ref string desc(),
[ domain ttaad.clan clan ],
[ long develop ] )

Read implementation function description of the code arg

pre : arg is the implementation function code in the format of ppmmmssssssss.fffff
clan is optional, default language$
develop is optional
false: read description in runtime VRC tree. [default]
true : read description in development VRC tree (ttadv040)
post: true - desc filled with business object description
false - desc is empty

function extern long read.label.desc(
string arg(40),
ref string desc(),
[ domain ttaad.clan clan ],
[ long develop ] )

Read label description of the labelcode arg

pre : arg is the label code in the format of pplllllllllllllll
clan is optional, default language$
develop is optional
false: read description in runtime VRC tree. [default]
true : read description in development VRC tree (ttadv040)
post: true - desc filled with label description
false - desc is empty

function extern long read.menu.desc(
string arg(40),
ref string desc(),
[ domain ttaad.clan clan ],
[ long develop ] )

Read menu description of the menu code arg

pre : arg is the menu code in the format of ppnnnmmmmmmmmp
clan is optional, default language$
develop is optional
false: read description in runtime VRC tree. [default]
true : read description in development VRC tree (ttadv040)
post: true - desc filled with menu description
false - desc is empty

function extern long read.message.desc(
string arg(40),
ref string desc(),
[ domain ttaad.clan clan ],
[ long develop ] )

Read message description of the message code arg

pre : arg is the messgae code in the format of ppmmmmmmmmmmmmm
clan is optional, default language$
develop is optional
false: read description in runtime VRC tree. [default]
true : read description in development VRC tree (ttadv040)
post: true - desc filled with message description
false - desc is empty

function extern long read.relation.desc(
ref string arg(),
ref string desc(),
long diagram,
[ domain ttaad.clan clan ],
[ long develop ] )

Read relation description

pre : arg is the session code in the format of ppmmmssssssss.fffff
diagram
false: description is not a part of a block
true : desrcition is part of a block
clan is optional, default language$
develop is optional
false: read description in runtime VRC tree. [default]
true : read description in development VRC tree (ttadv040)
post: true - desc filled with relation description
false - desc is empty

function extern long read.report.desc(
string arg(40),
ref string desc(),
[ domain ttaad.clan clan ],
[ long develop ] )

Read report description of the report code arg

pre : arg is the report code in the format of ppmmmrrrrrrrrr
clan is optional, default language$
develop is optional
false: read description in runtime VRC tree. [default]
true : read description in development VRC tree (ttadv040)
post: true - desc filled with report description
false - desc is empty

function extern long read.session.desc(
const string arg(),
ref string desc(),
[ domain ttaad.clan clan ],
[ long develop ] )

Read session description of the session code arg

pre : arg is the session code in the format of ppmmmssssssss[.compnr.time]
clan is optional, default language$
develop is optional
false: read description in runtime VRC tree. [default]
true : read description in development VRC tree (ttadv040)
post: true - desc filled with session description
false - desc is empty

function extern long read.subf.desc(
string arg(40),
ref string desc(),
[ domain ttaad.clan clan ],
[ long develop ] )

Read subfunction description of the subfunction code arg

pre : arg is the subfunction code in the format of ppmmmssssssss.fffff
clan is optional, default language$
develop is optional
false: read description in runtime VRC tree. [default]
true : read description in development VRC tree (ttadv040)
post: true - desc filled with subfunction description
false - desc is empty

function extern long read.table.description(
string arg(40),
ref string desc(),
[ domain ttaad.clan clan ],
[ long develop ] )

Read table description of the table code arg

pre : arg is the session code in the format of ppmmmtttttt
clan is optional, default language$
develop is optional
false: read description in runtime VRC tree. [default]
true : read description in development VRC tree (ttadv040)
post: true - desc filled with table description
false - desc is empty

function extern long read.table.field.description(
string arg(40),
ref string desc(),
[ domain ttaad.clan clan ],
[ long develop ] )

Read tablefield description of the tablefield code arg

pre : arg is the session code in the format of ppmmmssssssss.fffff
clan is optional, default language$
develop is optional
false : read description in runtime VRC tree. [default]
true : read description in development VRC tree (ttadv040)
post: true - desc filled with tablefield description
false - desc is empty

function extern long search.endpos(
ref domain ttdesc215 text mb )

This function searches the last position of the hypertext code

Pre: text variable starts with first character after a keyword
(not a '@')
Post: -

Ret: the end position of the hypertext code will be returned
relative to the first character after the keyword

george7a
24th October 2007, 09:39
It is used to display an image on a baan session

Syntax:
long image.display( const string image.path() )

Original reference:
http://www.baanboard.com/baanboard/showthread.php?t=9655

P.S. not available in Baan IV. But there are other ways to do it

Hitesh Shah
25th October 2007, 16:30
Here are good functions to find label description in ottdllwt_ls which can also be used in an OLE application to get labels from Baan without bothering for VRC structures .

function extern string get.label.desc(
domain ttaad.clan lang$,
domain ttadv.cpac cpac$,
domain ttadv.clab label$,
long l.length,
long l.height,
domain ttst30 context$ )

desc:
get label description, when no label found with specified length and
height, the best fit label will be retrieved
NOTE: the longest fitting label is retrieved, even when a newer
(shorter) version is available in a more recent VRC; if you want to
retrieve the most recent version, use 'get.newest.label.desc()'
in:
lang$ - language code
cpac$ - package code label
label$ - label code
l.length - max length of label to search for (-1 means search
for longest label)
l.height - max height of label to search for (-1 means search
for highest label)
context$ - string containing context group of label
out:
l.length - length of found label
l.height - height of found label
ret:
string containing label description when label found empty string when
label not found or no package integration

function extern string get.newest.label.desc(
domain ttaad.clan lang$,
domain ttadv.cpac cpac$,
domain ttadv.clab label$,
long l.length,
long l.height,
domain ttst30 context$ )

desc:
get the "newest" label description (i.e., with the most recent VRC)
which fits in the supplied maximum length/height.
If there are multiple desciptions in that VRC, the largest one
will be retrieved
in:
lang$ - language code
cpac$ - package code label
label$ - label code
l.length - max length of label to search for
(0 means: find shortest label)
l.height - max height of label to search for
context$ - string containing context group of label
out:
l.length - length of found label
l.height - height of found label
ret:
string containing label description when label found
empty string when label not found or no package integration

function extern long getlabel(
domain ttaad.clan clan.i,
domain ttadv.cpac cpac.i,
domain ttadv.clab clab.i,
ref domain ttadv.llen leng.io,
ref domain ttadv.lhgt lhgt.io,
ref domain ttadv.vers vers.io,
ref domain ttadv.rele rele.io,
ref domain ttadv.cust cust.io )

Pre: Language, package, label code and the starting VRC parameters
have to have an exact value.
To find the longest label set the length parameter to its maximum.
To find the shortest label set the length parameter to its minimum (0).
Language and package parameters not checked.
Post: Language, package and label code is not changed in function.
The other parameters can be changed.
Desc: This function searches for a label and returns its complete key.
The whole VRC tree is searched starting with the current P-VRC.
The function returns the label that has the length equal or smaller
and height equal or greater than the given length and height.
Ret: -1: Label not found
0: OK, the specified label exists
1: OK, label found in VRC tree
2: OK, label found with different length/height
3: OK, lable found in VRC tree with different length/height
The length, height and VRC parameters contains the the index values
of the found label.

george7a
29th October 2007, 11:06
More undocumented functions that there is no info on them yet:

get
rdi.option.info
rdi.session.form
rdi.session.subject.info
rdi.session.subject
create.arglist
add.arg
destroy.arglist
get.attrs
put.attrs
sget.fld.attr
read.fast.form
get.ref.var
put.ref.var

Hitesh Shah
30th October 2007, 16:23
ttdllfilehand has some very good functions for file handling which works also on remote servers.
Original reference - http://www.baanboard.com/baanboard/showthread.php?t=6034&highlight=ttdllfilehand


---------------------------DLL USAGE DESCRIPTION------------------------
This library contains functions for handling files.
Unless stated otherwise in the specification of the function, each
function can be used for both local and remote files.

Note:
Function ttadv0010.convert.filename, ttadv0010.file_copy and
ttadv0010.file_move should not be used. They only are in this dll
for compatibility with existing sources.
In stead of ttadv0010.convert.filename(source, target) use:
convert.filename.for.remote(source, target)
In stead of ttadv0010.file_copy(source, target) use:
file.copy.or.move(source, target) or
file.copy.or.move(source, target, 0)
In stead of ttadv0010.file_move(source, target) use:
file.copy.or.move(source, target, 1)


---------------------------DLL PROTOTYPES-------------------------------
function extern app.file(
const string source(),
const string target(),
ref long ret )

pre: true
desc: Copy file source to file target. Source and target
may be on a remote host (host!pathname)
return: 0: succesfull
1: Source file is empty
2: Source not present
3: Cannot open file

function extern convert.filename.for.remote(
const string source(),
ref string target() )

pre: Format of source is <pathname> or <hostname>!<pathname>,
so source contains no more than one '!', which may not be
on first position
post: if source contains no "!" and BSE_REM is set then
target = <BSE_REM>!<source>
if source is <hostname$()>!<rest.source> then
target = <src>
otherwise
target = <source>

function extern copy.file(
const string source(),
const string target(),
ref long ret,
[ long euro ] )

pre: true
desc: Copy file source to file target. Source and target
may be on a remote host (host!pathname)
return: 0: succesfull
1: Source file is empty
2: Source not present
3: Cannot open file

function extern long copy.move.file(
long copy,
const string fpath(),
const string tpath(),
[ long euro ] )

function extern long cp.dir.and.subdirs(
const string src(),
const string trg() )

pre: true
post: Direcory dir and all sub directories are cpied.
1: Error
0: ok

function extern long create.directory(
const string directory() )

pre: true
return: true if directory cannot be created or
directory already exists but cannot be written;
false if directory already exists and can be written or
directory is created succesfully.
post: if return = true then an error message is produced.
note: if messages are not required, use mkdir or mkdir.rem in stead.

function extern long create.local.temp.file(
const string path(),
ref string local.path() )

post: If path denotes a remote file, this function has copied the
contents of that file to a temporary file local.path,
created in bse.tmp.dir$.
If path denotes a local file, local.path = path.
return: If an error occurs when copying the file to local,
then true is returned, otherwise false is returned.
note: local.path should be removed using remove.local.temp.file
(using seq.unlink may result in a serious error).

function extern long dir.present(
const string directory() )

pre: true
return: This function returns true if directory is an existing
directory and can be written.
Otherwise (file does not exist or file is no directory or
user has no write permission for file) it returns false.

function extern long edit.file(
const string programm(),
const string fname(),
long read.only )

function extern long file.cmp(
const string file1(),
const string file2() )

pre: true
return: 1: Files are different.
0: Files are equal.
-1: Error occurred. Probably one of the files not present.

function extern long file.copy.or.move(
const string source(),
const string target(),
[ long mode ] )

pre mode = 0 (for copy) or 1 (for move)
(mode is optional: if not supplied default is 0);
source and target are file names, they may be remote, i.e.
having the format <host>!<file name>
return 0 = ok, <> 0 = error
possible errors:
if source and target are local:
could not move/copy;
if source or target is remote:
could not open source file;
could not read source file;
could not open target file;
could not write target file;
if mode = 1: source file could not be removed.
post if return = 0
if mode = 0 (or mode is not supplied):
file souce has been copied to file target;
if mode = 1:
file souce has been moved to file target.
if return <> 0
copy/move was not executed correctly;
a error message has been given.

function extern long file.present(
const string path() )

pre: true
return: This function returns true if path is an existing
regular file and can be written.
Otherwise (file does not exist or file is no regular file or
user has no write permission for file) it returns false.

function extern long is_dir(
const string dirname() )

pre: true
return: -1 : file does not exist
0 : file exists but is not a directory or
file is directory but user has no write permission for it
1 : file is directory and user has write permission for
this directory

function extern long is_file(
const string path() )

pre: true
return: -1 : file does not exist
0 : file exists but is not a regular file or file
is regular file but user has no write permission for it
1 : file is regular file and user has write permission for
this file

function extern long local.to.remote(
const string source(),
const string target() )

function extern long mkdir.rem(
const string directory() )

pre: true
return: -1 in case of failure, 0 if path already exists,
1 in case of succes.
post: if return = 0: directory already existed;
if return = 1: directory has been created.
desc: Function mkdir is working for remote directories,
but returns 1 in stead of 0 if path already exists.
This function mkdir.rem is dealing with remote directories
in exactly the same manner as it is with local directories.

function extern move.file(
const string source(),
const string target(),
ref long ret,
[ long euro ] )

pre: true
desc: Moves file source to file target. Source and target
may be on a remote host (host!pathname)
return: 0: succesfull
1: Source file is empty
2: Source not present
3: Cannot open file
4: Cannot remove target file

function extern long mv.dir.and.subdirs(
const string src(),
const string trg() )

pre: true
post: Direcory dir and all sub directories are moved.
1: Error
0: ok

function extern long pack.patch(
const domain ttadv.path path.dumps,
const domain ttadv.path path.patch,
const string patch.code() )

Desc: - Pack a directory structure containing dump files after
generation of a patch into a single file
Pre: - Sessions create patch (ttiex4110m000) and export
datadictionary (ttiex1280s000) have produced a
directory structure containing dump files
- When ttseq.automess.on() is called, error messages are shown
Post: - Creates a packed patch file
Return: error code < 0 is failure, >= 0 is success
Input: path.dumps -> Path of directory structure
path.patch -> Path of directory to contain patch file
patch.code -> Name of patch
Output: -

function extern long pattern.in.file(
const string file(),
const string pattern() )

pre: true
desc: 1: The pattern is in the file
0: The pattern is not in the file.
< 0: An error occurred. Probably the file cannot be read.

function extern long remote.to.local(
const string source(),
const string target() )

function extern long remove.local.temp.file(
const string path(),
ref string local.path() )

pre: local.path is temporary local path for path; local.path is
created by function create.local.temp.file.
post: If path is local (so local.path = path) then nothing will be
done. If path is not local this function removes the temporary
file local.path.
return: 0 if path is local, otherwise the return value for
seq.unlink(local.path)

function extern long rm.dir.and.subdirs(
const string src() )

pre: true
post: Direcory dir and all sub directories are removed.
1: Error
0: ok

function extern ttadv0010.convert.filename(
const string source(),
ref string target() )

This function is only in this dll for compatibility reasons.
Do not use it.
Use convert.filename.for.remote(source, target) in stead.

function extern long ttadv0010.file_copy(
const string source(),
const string target() )

This function is only in this dll for compatibility reasons.
Do not use it.
Use file.copy.or.move(source, target) or
file.copy.or.move(source, target, 0) in stead.

function extern long ttadv0010.file_move(
const string source(),
const string target() )

This function is only in this dll for compatibility reasons.
Do not use it.
Use file.copy.or.move(source, target, 1) in stead.

function extern long unpack.patch(
const domain ttadv.path path.src,
const domain ttadv.path path.dest,
... )

Desc: - Unpack a patch file containing a packed directory
structure of dump files. The directory structure
is created in a specified directory.
Pre: - A patch file must have been created by sessions
create patch (ttiex4110m000) and export
datadictionary (ttiex1280s000).
- When ttseq.automess.on() is called, error messages are shown
Post: - Creates a directory structure
Return: error code < 0 is failure, >= 0 is success
Input: path.src -> Path of patch file
path.dest -> Path of directory structure
Output: -

Hitesh Shah
5th November 2007, 08:23
Dynamic expressions functions (expr.*) have been one of the best amazing functions of Baan 4GL.It is nicely
documented. However there are certain tricks and techniques related to these functions which are little
known / documented.

Also many senior members have deployed it succcessfully. So no original refeernce to any thread is included.
This post may be more for new members.

This function lets user create dynamic expressions (DE) and use the same repeatedly in the program. When
there is error in compiling and / or evaluating DE , the value of pre-defined variable 'e' is raised along
with BW messages.Programmer can theck the value of 'e' to check if the error occurred in compiling/evaluating
expression.BW messages can be avoided by selecting 'Not action' in 'BW message window option' tab in
option dialog. There is no way to change the same programmatically . The variables to be used in dynamic
expressions must be declared extern.

exp.compile allows lot of functions to be used in the DEs. Though there is no syntax for these function
calls , these functions work perfect and work on the same lines of same function in Baan 4GL (may be with
$ suffix like str$,edit$ , strip$ etc ). These DEs are very useful in letting users control the definition of engineering
parameters (which may change with each product ). Users can key multiple expressions in a text separated
by,zoom to variables in text , do assignments for long repeated expressions, do conditional iterations using ?
and : , format the output using edit , round the value. convert string to numeric and reverse .


The DEs are also very useful in calculated items , query fields lookups in reference table, dynamic formulae,
dynamic dll function calling , dynamic expression creating hierarchies,domain range validation for any data type
in string field . Powerful pattern matching and conditional evaluation in DEs work extra-oridnarily .

e.g.In OLAP , classification / categorization /grouping of data at row level is termed as calculated item. e.g.
if u wish to categorize the sales invoice value (tfacr200.amth ) as per table below

Category Invoice value
A >1000,000
B >500,000
C >100,000
D upto 100,000

Such categorization can be also for alphanumeric data also e.g. All customers beginning with A as LOB 1,
beginning with B to D as LOB 2 and rest LOB 3.

both categorizations can dynamically be created and evaluated runtime easily like .

tfacr200.amth > 500000 ? tfacr200.amth > 1000000 ? "A" : "B" : tfacr200.amth > 100000 ? "C":"D"
OR
tfacr200.amth > 1000000 ? "A" : tfacr200.amth > 500000 ? "B" : tfacr200.amth > 100000 ? "C" : "D"

tfac200.cuno in "A.*"? "LOB 1": tfac200.cuno in "[B-D].*"? "LOB 2" : "LOB 3"

Standard Baan uses these expr.functions extensively in many areas . So the knowledge of these functions can
help user get best in these areas.

1.Input/ref argument for a field to check whether input is allowed on the field or not .
2.Job / user default settings saved in ttaad503 / ttadv990
3.showing the value of an expression and evaluating an expression for stop if condition in program debugger.
4.Range validation for a domain .

The string length for the dynamic expression should be keplt maximum for allowing different variations
and length of data.

Thus DEs are great and are very handy in handling small DEs but It can not do all that baan 4gl functions and
SQL queries can do. This should be kept in mind when deploying it.

george7a
9th November 2007, 10:18
ttgfd300.titl is found in every 4GL session and it contains the session title.

Original reference:
http://www.baanboard.com/baanboard/showthread.php?t=29046&page=2

Hitesh Shah
4th January 2008, 05:12
Good function for creating / extracting single zipped archieve file in Baan IV in ttdllzip . In windows environs,the directory and file arguments with colons (absolute address) does not work. However arguments without colon (ie relative to present working dir $BSE_TMP ) is working nicely.




function extern long pack(
const string tar_file_name(),
const string dir_name(),
[ const string file_list() ] )

function extern long pack.and.zip(
const string tar_file_name(),
const string src_dir_name(),
[ const string user_list() ] )

function extern long pack.extract.filelist(
const string tar_file_name(),
const string file_list() )

function extern long unpack(
const string tar_file_name(),
const string dir_name() )

function extern long unzip(
const string file_name() )

function extern long unzip.and.unpack(
const string tar_file_name(),
const string dest_dir_name() )

function extern long zip(
const string file_name() )

NirajKakodkar
4th January 2008, 06:27
This library contains functions to execute sql-queries through an
OLE-interface.


Contents (external functions):
- easysql_to_olesql(const string sqlname(), ref string query())
Convert an easy sql expression to a normal sql query, that can
be used in the following functions.

- olesql_parse(string query(4096))
Parse and execute the sql-query.

- olesql_fetch(long sql_id)
Fetch the next query-result.

- olesql_getstring(string varname(17), ref string svalue)
Retrieve the value of a variable (of type string).

- olesql_getstring_arrelem(string varname(17), long elem,
ref string svalue)
Retrieve the value of an array variable (of type string).

- olesql_getint(string varname(17), ref long ivalue)
Retrieve the value of a variable (of type integer)

- olesql_getint_arrelem(string varname(17), long elem,
ref long ivalue)
Retrieve the value of an array variable (of type string).

- olesql_getfloat(string varname(17), ref double fvalue)
Retrieve the value of a variable (of type float).

- olesql_getfloat_arrelem(string varname(17), long elem,
ref double fvalue)
Retrieve the value of an array variable (of type float).

- olesql_getdate(string varname(17), ref string sdate)
Retrieve the value of a variable (of type date).

- olesql_getdate_arrelem(string varname(17), long elem,
ref string sdate)
Retrieve the value of an array variable (of type date).

- olesql_getutcdate(string varname(17), ref string sdate)
Retrieve the value of a variable (of type utc date).

- olesql_getutcdate_arrelem(string varname(17), long elem,
ref string sdate)
Retrieve the value of an array variable (of type utc date).

- olesql_getenum(string varname(17), ref string senumval,
ref long lenumval)
Retrieve the value of a variable (of type enumerate).

- olesql_getenum_arrelem(string varname(17), long elem,
ref string senumval,
ref long lenumval)
Retrieve the value of an array variable (of type enumerate).

- olesql_close(long sql_id)
Close the sql query.

- olesql_break(long sql_id)
Break the sql query.

NirajKakodkar
4th January 2008, 06:59
This Library contains a number of functions that can be used to create,
update and retrieve information on a DEM user:
create_userdata(...): Create a new user, based on the current user
update_userdata_company(...): Change the startup company of the user
update_userdata_wtsettings(...): Change the worktop settings of the user
read_userdata_wtsettings(...): Retrieve the worktop settings of the user

Following Error values are used:
0 No errors
-1 User already exists
-2 User not found
-3 Conversion of userdata to runtime failed
-4 Conversion of role to runtime failed
-5 Company not supported by package combination
-6 Company not found
-7 No authorization for company
-8 Package not in this package combination
-9 Module not found
-10 Menu not found
-11 Menu is expired





long create_userdata( const domain ttaad.user user, const domain ttdsca name mb, domain ttaad.comp company, long uses.mb, long uses.pb, long uses.wlh, const domain ttadv.cpac cpac, const domain ttadv.cmod cmod, const domain ttadv.cmen cmen )

long read_userdata_wtsettings( const string user(), ref long uses.wt, ref long uses.mb, ref long uses.pb, ref long uses.wlh, ref domain ttadv.cpac cpac, ref domain ttadv.cmod cmod, ref domain ttadv.cmen cmen )

long update_userdata_company( const string user(), long company )

long update_userdata_wtsettings( const string user(), long uses.mb, long uses.pb, long uses.wlh, const domain ttadv.cpac cpac, const domain ttadv.cmod cmod, const domain ttadv.cmen cmen )

NirajKakodkar
4th January 2008, 07:40
This is a very good Library , having functions to search path of any given component like form , object , program script , report script ....


void iadv0029.fill.pvrc( domain ttadv.cpac p fixed, domain ttadv.vers v fixed, domain ttadv.rele r fixed, domain ttadv.cust c, ref string pvrc() )

long search.path( domain ttadv.cpac cpac fixed, domain ttadv.vers vers fixed, domain ttadv.rele rele fixed, domain ttadv.cust cust fixed, domain ttadv.kord kord, ref string path() )

long search.path.afil( domain ttadv.cpac cpac fixed, domain ttadv.vers vers fixed, domain ttadv.rele rele fixed, domain ttadv.cust cust fixed, domain ttadv.cmod cmod fixed, domain ttadv.pblb afil fixed mb, ref string path.afil() )

long search.path.form( domain ttadv.cpac cpac fixed, domain ttadv.vers overs fixed, domain ttadv.rele orele fixed, domain ttadv.cust ocust fixed, domain ttadv.cmod cmod fixed, domain ttadv.cfrm cfrm fixed, domain ttaad.clan clan, ref string path.form() )

long search.path.function( domain ttadv.cpac cpac fixed, domain ttadv.vers vers fixed, domain ttadv.rele rele fixed, domain ttadv.cust cust fixed, domain ttadv.cmod cmod fixed, domain ttadv.cfun cfun fixed, ref string path.func.head(), ref string path.func.body() )

long search.path.menu( domain ttadv.cpac cpac fixed, domain ttadv.vers vers fixed, domain ttadv.rele rele fixed, domain ttadv.cust cust fixed, domain ttadv.cmod cmod fixed, domain ttadv.cmen cmen fixed, domain ttadv.parm parm fixed, domain ttaad.clan clan, ref string path.menu() )

long search.path.object( domain ttadv.cpac cpac fixed, domain ttadv.vers vers fixed, domain ttadv.rele rele fixed, domain ttadv.cust cust fixed, domain ttadv.cmod cmod fixed, domain ttadv.cprs cprs fixed, ref string path.object() )

long search.path.program.script( domain ttadv.cpac cpac fixed, domain ttadv.vers vers fixed, domain ttadv.rele rele fixed, domain ttadv.cust cust fixed, domain ttadv.cmod cmod fixed, domain ttadv.cprs cprs fixed, ref string path.script() )

long search.path.repobj( domain ttadv.cpac cpac fixed, domain ttadv.vers overs fixed, domain ttadv.rele orele fixed, domain ttadv.cust ocust fixed, domain ttadv.cmod cmod fixed, domain ttadv.crep crep fixed, domain ttaad.clan clan, ref string path.report() )

long search.path.report.script( domain ttadv.cpac cpac fixed, domain ttadv.vers vers fixed, domain ttadv.rele rele fixed, domain ttadv.cust cust fixed, domain ttadv.cmod cmod fixed, domain ttadv.crep crep fixed, ref string path.report() )

NirajKakodkar
4th January 2008, 07:54
These are some more undocumented functions which I come across , dont know much about the usage though .


long idb.cache.size(domain tcmcs.str8 table.name,domain tcncmp search.comp)

This function is used to Check if combination table is already cached ,
It returns the cache size and if it returns 0 , that means the table is not cached .



idb.physical.access.on(domain tcmcs.str8 table.name,domain tcncmp search.comp)

This function will switch the read mode in that way that it
will perform a physical database action when data is not
found in internal memory.

NirajKakodkar
4th January 2008, 08:44
This is one more dll , which is really very good , meant for copying report as its name suggest .

Note : I found all this DLL in LN6.1 environment , have not checked it in previous versions but its possible that these are present in earlier versions too .


void

copy.report( domain ttaad.clan clan, domain ttadv.cpac cpac.f fixed, domain ttadv.cpac cpac.t fixed, domain ttadv.vers vers.f fixed, domain ttadv.vers vers.t fixed, domain ttadv.rele rele.f fixed, domain ttadv.rele rele.t fixed, domain ttadv.cust cust.f fixed, domain ttadv.cust cust.t fixed, domain ttadv.cmod cmod.f fixed, domain ttadv.cmod cmod.t fixed, domain ttadv.crep crep.f fixed, domain ttadv.crep crep.t fixed, domain ttyeno header.exist, long also.reln, long keep.link, [ long ukey ], [ long also.copy.script ] )
void

delete.report( domain ttaad.clan clan.t, domain ttadv.cpac cpac.t fixed, domain ttadv.vers vers.t fixed, domain ttadv.rele rele.t fixed, domain ttadv.cust cust.t fixed, domain ttadv.cmod cmod.t fixed, domain ttadv.crep crep.t fixed, domain ttyeno delete.header, domain ttyeno also.texts, domain ttyeno also.objects, [ long ignore.presence.of.linked.languages ] )
long

iadv0016.check.adv330.present( domain ttaad.clan clan.t, domain ttadv.cpac cpac.t fixed, domain ttadv.vers vers.t fixed, domain ttadv.rele rele.t fixed, domain ttadv.cust cust.t fixed, domain ttadv.cmod cmod.t fixed, domain ttadv.crep crep.t fixed )
void

iadv0016.del.adv150.and.txt( domain ttadv.cpac cpac.t fixed, domain ttadv.vers vers.t fixed, domain ttadv.rele rele.t fixed, domain ttadv.cust cust.t fixed, domain ttadv.cmod cmod.t fixed, domain ttadv.crep crep.t fixed, domain ttadv.hdre hold.hdre )
void

iadv0016.delete.adv330.children( )
void

iadv0016.delete.adv332( domain ttadv.cpac cpac fixed, domain ttadv.vers vers fixed, domain ttadv.rele rele fixed, domain ttadv.cust cust fixed, domain ttadv.cmod cmod fixed, domain ttadv.crep crep fixed )
void

iadv0016.delete.rep.script( domain ttadv.cpac cpac.t fixed, domain ttadv.vers vers.t fixed, domain ttadv.rele rele.t fixed, domain ttadv.cust cust.t fixed, domain ttadv.cmod cmod.t fixed, domain ttadv.crep crep.t fixed )

NirajKakodkar
4th January 2008, 08:46
This library contains functions operating on Additional Files.

Additional Files do not have a predefined use, which other components like
sessions, scripts and messages have.
Additional Files are generic software components, which applications can use.
Examples of Additional Files are gif files or xml files.

The advantages of using Additional Files are:
- additional files can be delivered with a package just like any other
software component;
- version control on additional files is available.


long

ttdll.afile.list.current.afiles.for.pvrc.having.extension( domain ttadv.cpac i.package, domain ttadv.vers i.version, domain ttadv.rele i.release, domain ttadv.cust i.customer, domain ttadv.cmod i.module.from, domain ttadv.cmod i.module.to, domain ttadv.bext i.extension, ref long o.afiles )
void

ttdllafile.copy.data( domain ttadv.cpac cpac_f, domain ttadv.cpac cpac_t, domain ttadv.vers vers_f, domain ttadv.vers vers_t, domain ttadv.rele rele_f, domain ttadv.rele rele_t, domain ttadv.cust cust_f, domain ttadv.cust cust_t, domain ttadv.cmod cmod_f, domain ttadv.cmod cmod_t, domain ttadv.pblb afil_f mb, domain ttadv.pblb afil_t mb )
long

ttdllafile.create( domain ttadv.cmod i.module, domain ttadv.pblb i.afile mb, const string i.source.file(), const string i.description(), long i.is.editable, long i.overwrite )
long

ttdllafile.create.set( domain ttadv.cmod i.module, const string i.source.path(), const string i.description(), long i.is.editable, long i.overwrite )
long

ttdllafile.delete.data( domain ttadv.cpac cpac_f, domain ttadv.vers vers_f, domain ttadv.rele rele_f, domain ttadv.cust cust_f, domain ttadv.cmod cmod_f, domain ttadv.pblb afil_f mb )
long

ttdllafile.exists( domain ttadv.cpac i.package, domain ttadv.cmod i.module, domain ttadv.pblb i.afile mb, domain ttadv.vers i.version, domain ttadv.rele i.release, domain ttadv.cust i.customer )
long

ttdllafile.get( domain ttadv.cpac i.package, domain ttadv.cmod i.module, domain ttadv.pblb i.afile mb, domain ttadv.vers i.version, domain ttadv.rele i.release, domain ttadv.cust i.customer, ref string o.file(), [ ref string o.description() ], [ ref long o.is.editable ] )
long

ttdllafile.get.current( domain ttadv.cpac i.package, domain ttadv.cmod i.module, domain ttadv.pblb i.afile mb, ref string o.file(), [ ref string o.description() ], [ ref long o.is.editable ] )
long

ttdllafile.get.current.incl.tt( domain ttadv.cpac i.package, domain ttadv.cmod i.module, domain ttadv.pblb i.afile mb, ref string o.file(), [ ref string o.description() ], [ ref long o.is.editable ] )

NirajKakodkar
4th January 2008, 08:49
This infact , I guess a lot of people will be aware of .

This library contains functions to retrieve runtime information on sessions.
It is possible to retrieve the general runtime information on a session, or the
scm runtime information (for a checked out session).

Following functions can be used:
function boolean get.session.info(session, pacc, runtime.info)
function boolean get.general.session.info(session, pacc, runtime.info)
function boolean get.scm.session.info(session, pacc, runtime.info)
function bset get.session.workflow.status(sessionname, [pacc])
function boolean session.is.dynamic(session, pacc)
function boolean session.is.main(session, pacc)
function boolean session.is.sub(session, pacc)
function string get.session.type(session, pacc)
function domain ttadv.ztyp get.session.window.type(session, pacc)


long

get.general.session.info( const string session(), const string pacc(), ref string runtime.info() )
long

get.scm.session.info( const string session(), const string pacc(), ref string runtime.info() )
long

get.session.info( const string session(), const string pacc(), ref string runtime.info() )
string

get.session.type( const string session(), const string pacc() )
domain ttadv.ztyp

get.session.window.type( const string session(), const string pacc() )
bset

get.session.workflow.status( const string session(), [ domain ttaad.pacc pacc ] )
long

session.is.dynamic( const string session(), const string pacc() )
long

session.is.main( const string session(), const string pacc() )
long

session.is.sub( const string session(), const string pacc() )

NirajKakodkar
4th January 2008, 09:09
This one is one more great dll , really very useful for converting ascii text to html .

void

convert.html.helptext( ref string filename(), domain ttaad.clan clan, ref string code(), domain ttadv.ktex type, ref string helpfile(), ref string help.grp(), ... )
long

convert.topic.to.html( ref string line(), long posi, domain ttaad.clan clan, domain ttadv.cpac cpac, string help.grp(8), string helpfile(20), string help_keyw(50), ref long reset.cf, ref long fixed.fnt, ref long ident, long insert.gl, ref long textnr.gl, ref string bitmap() )
void

end.html.file( long lfn )
void

html.ident.off( const string id.str(), ref string line() )
void

html.ident.on( long ident, const string id.str(), ref string line() )
void

init.html.file( long lfn, const string title() )
void

write.html.contents.file( domain ttaad.clan clan, domain ttadv.hgrp hgrp, domain ttadv.hptp hptp, domain ttadv.cpac cpac, const string filename() )
void

write.html.ctx.header.definition( const string filename(), const string title() )
void

write.html.frame.definition( const string filename(), domain ttadv.ktex type, const string title() )
void

write.html.gl.main( const string filename() )
void

write.html.glossary.list( domain ttaad.clan clan, domain ttadv.hgrp hgrp, domain ttadv.hptp hptp, domain ttadv.cpac cpac, const string filename() )
void

write.html.om.header.definition( domain ttadv.cpac cpac, const string filename(), const string title(), const string prev.topic(), const string next.topic() )
void

write.html.om.main( domain ttadv.cpac cpac, const string filename() )
void

write.tmp.file( const string tmp.file(), const string html_file() )

NirajKakodkar
4th January 2008, 12:25
This is one of my old threads which talks about

ttdskcs
ttdskmsg


http://www.baanboard.com/baanboard/showthread.php?t=5774
http://www.baanboard.com/baanboard/showthread.php?t=28319

These are sessions and can be run in BaaN 4/5/6 , I have tried in all , but dont have much information about it , If any of you all have used these please post your findings .

NirajKakodkar
4th January 2008, 12:58
This is a very good Library with all clipboard functions .


string bms_clipboard( )

string bms_clipboard_ret( )

void clear.clipboard( )

long clipboard_clear( )

long clipboard_copy( )

long clipboard_cut( )

long clipboard_paste( )

void copy.to.clipboard( const string tag(), const string mss() )

void cut.to.clipboard( const string tag(), const string mss() )

void paste.from.clipboard( const string tag(), ref string mss() )

long tag_len( )

NirajKakodkar
4th January 2008, 13:01
Yet another DLL with clipboard functions
ttdskdisplay


long clipboard.to.file( const string image.path() )

long clipboard.to.image( const string image.path(), ref long width, ref long height )



Though not used but seems useful .

NirajKakodkar
4th January 2008, 13:03
Though not so big one , but quite useful in some cases

This library contains functions to check if a program is a main session
or an object



long is.main.process( string prog(14) fixed )

long is.main.process.no.mess( string prog(14) fixed )

Hitesh Shah
4th January 2008, 13:56
Niraj, Thanks a lot for making this thread very interesting despite the fact that u r extremely busy .

For Baan IV members , some clarifications may help . ottdllsql_query is extremely good. ottdlluser / ottdllsess.info/ ottdllcopyrprt / ottdllafile does not exist in Baan IV . In Baan 4GL pathname is a good function get components runtime path .

Re ttdskcs - a member has already worked on http://www.baanboard.com/baanboard/showthread.php?t=15115&highlight=ttdskcs. He can shed more light on this . This session lets u select color in a user friendly manner by manipulating RGB values and u can use these RGB values in 4GL function RGB(long red,long green, long blue) for painting screen manually using object functions.

NirajKakodkar
8th January 2008, 12:26
Here there is one more session which is really very good , which creates a function server DLL of any session provided .

ttstpcreatdll


This can be found in Baan 4/5/6

This can be read in this thread also
http://www.baanboard.com/baanboard/showthread.php?t=656

rajeshk
22nd January 2008, 08:16
G'Day Mates! Does any one know what the function "get.ref.var(pid)" does? I think it takes one parameter that of the parent process pid. I couldn't find it in the manuals.

Thanks in advance. :)

george7a
22nd January 2008, 09:50
get.ref.var() is not mentioned in the manuals (at least in the ones I have). I still do not know what it does exactly. I mentioned it in this post (http://www.baanboard.com/baanboard/showpost.php?p=127779&postcount=41).
However, it looks similar to get.var() function (http://www.baanboard.com/programmers_manual_baanerp_help_functions_variables_interprocess_transfer_get_var).

rajeshk
22nd January 2008, 10:36
the usage i saw was in the following context:

1) session X calls session Y and waits.
2) Y completed processing and then does a get.ref.var(parent)

i was wondering what role is it playing in this inter process communication.

george7a
22nd January 2008, 10:41
I have found the function in this example:
http://www.baanboard.com/programmers_manual_baanerp_help_4gl_features_flow_of_standard_program

rajeshk
22nd January 2008, 10:47
yeah! fact is this is the only instance of it i found in my manuals. no explanations. :(

Hitesh Shah
22nd January 2008, 13:03
In that contenxt , it is certainly not a function . All it tries to say if the standard program knows that its called from another program , it will initialize the pid of the calling program as parent variable and read the main table buffer from the parent program .

U can view other supposed functions in the same help like read.form() ,put.attributes() , on.update.db() etc in the same help .

george7a
26th February 2008, 12:51
obj_in_core() takes one (ref) string argument and returns in it all the loaded objects (not just processes) with some info about them.

use:
obj_in_core(objs_data)
objs_data's value will be something like:

N N 1 27 ottdskbrowser
N N 1 3 ottdskmenu
N N 1 18 ottdskmbrowser
N N 4 31 ottstp_stddll
N N 1 2 ottadvexecperm
N N 1 10 ottstpshell
N N 1 57 ottstpstdlib

Explanation:

STICK SHM REF TSIZE OBJECT
Y N 4 29 ottstp_stddll
N N 1 71 ottadv2130
N N 1 11 ottstpmenu
N Y 1 35 ottstpstdlib
N N 1 146 ottstpstandard

STICK = indicates whether the object has the sticky bit on. This
means that the object should not be removed out of memory,
when the process ends
SHM = indicates whether the object is stored in shared memory
REF = reference counter, which shows how many processes use this
object
TSIZE = size of process in KB (text)
OBJECT = the object name

You will get a similar output of you open shell and type oic.

- George

george7a
29th February 2008, 11:54
From my testing I have found the following information about the oipstat function:

Syntax
long oipstat( long process_id, ref long object_number, ref string object_name)

Description
This returns status information about a specified object in a specified process.

Arguments
process_id
The ID of the process for which you want to retrieve information.

object_number
The sequence number of object in process_id

object_name
This returns the object code.

Return values
The object sequence number of the next object in the specified process_id

Example

long obj_num,rt.val
string obj_name(15)

rt.val = 1
while rt.val > 0
obj_num = rt.val
rt.val = oipstat (pid,obj_num,obj_name)
message(obj_name)
| This will go through all the objects this current script is using
endwhile

Comment
You can see the list of the objects for a specified process if you go to the shell and type the number of the process after the ps command. For example:
ps 2
I hope you find this helpful,

- George

george7a
4th March 2008, 14:17
get.cust.name takes no arguments and returns the company name that appears on Baan starup window as string.

Found in Baan IV

george7a
5th March 2008, 15:59
bse.portset$ takes no arguments and returns the Port no. as string

Check the following explanation:

[baanserv:bsp]/baan4c/bse/bin> licmon6.1 -v
-------------------------------------------------------
Portingset : 6.1c.06.07
Port no. : PA.2180 | <--- The function returns this value
...
..
.

found in Baan IV

- George

george7a
19th March 2008, 10:39
More inf on SWITCH.TO.PROCESS How to Combine two session in a one form (http://www.baanboard.com/baanboard/showthread.php?t=25379&highlight=switch.to.process)
wait.for.switch is switch.to.process's sister. It will wait for another process to call switch.to.process. This function is typically used at the startup of the zoom process for synchronization purposes. Possible flags:

SWITCH.SAME.SIZE
SWITCH.WITHOUT.INTERACTION

george7a
19th March 2008, 10:50
The variable sattr.combined should be used if the forms of the two processes should not overlap. This variable should be set in the before.program section. Possible values:

COMBINED.BOTTOM form stays below other process' form
COMBINED.TOP form stays on top of other process' form
COMBINED.RIGHT form stays at the right of other process' form
COMBINED.LEFT form stays at the left of other process' form

If the two processes should be of the same width or height, the value SWITCH.SAME.SIZE should be added to the flag argument.

Switching to another process also passes the input control to that process. This results in setting the current form inactive and setting the other form active. If it is not necessary to switch the focus to the other form (e.g. the other process is a display process without interaction), the flag SWITCH.WITHOUT.INTERACTION should be set. This flag should only be set in the process passing the control to the process without interaction. E.g.: proc2 is a single-occurrence session for maintaining an order line and proc1 is a multi-occurrence session, displaying the other order lines of the same order header. The user is not able to input on fields of proc1 nor able to enter commands for proc1. Only the switch.to.process call of proc2 should have the flag SWITCH.WITHOUT.INTERACTION set. To stop synchronization between the processes, set the flag argument to SWITCH.WITHOUT.WAIT. This should be used if the other process stops after receiving the switch.

george7a
19th March 2008, 10:55
The whole documentation of the "Functions For Switching Between A Parent Process And An Activated Child", can be found in this PDF file (http://www.baanboard.com/baanboard/attachment.php?attachmentid=2276&d=1123708699) (that was posted earlier (http://www.baanboard.com/baanboard/showthread.php?t=1292) on Baanboard) page 218.

Edit: These functions are found only in some Baan IV documentation. They are not documented in Baan V/LN, However, as I know, they are still working.

george7a
3rd June 2008, 14:12
Many times I needed to zoom to the "Display Sessions" session and I was expecting it to return the name of the selected session in one variable. As you may know, there was no way (that I know about) to do that. The work around was to define three fields: package, module & name and to zoom 3 times to get your session.

Well, not any more! I have found out that if the name of the field that your are zooming from was "ttadv301.zprg" then the zoomed session will return the whole session name into that field!

The following is how to define the field:
3801

I tried it in Baan IV, I got an error that I am having a wrong domain, but it saved it!

I hope you find this helpful,

- George

Hitesh Shah
4th June 2008, 18:16
It is not mandatory to use field 'ttadv301.zprg' to get session code . In fact if the form field code begins with 'tt' , it should be able to return the session code .

Further there are other displays sessions like ttadv2505s000 / ttadv2506s000 which gives more choice .e.g. U can get the session on any field code beginning with tf , tg and tu also. If the field code is table field from other packge , u can deploy following code in before.zoom section to get the session code .


field.timmmnnn.cccc:
before.zoom:
timmmnnn.cccc = zoom.to$("ttadv2506s000" ,z.session , "tuabcd","",0)
attr.zoomcode = 0


For display domains , it's very strict . The zoomname must be tuxch014.domn


field.tudll989.domn:
before.zoom:
ttadv400.cpac = tudll989.domn(1;2)
cpac = tudll989.domn(1;2)
ttadv400.cdom = tudll989.domn(3)
tudll989.domn = zoom.to$("ttadv4505s000",z.session,"tuxch014.domn","",0)
attr.zoomcode = 0



Original discussion in http://www.baanboard.com/baanboard/showthread.php?t=24770&highlight=ttadv2506s000 may be relevent.

george7a
27th October 2008, 13:08
Another similar issue to the last one is: getting the release code & customer extension fields automatically filled after choosing the version of the VRC.

The solution is simple though its not predicted (and not documented)! All you have to do is to rename your session variables to: "vers", "rele" & "cust". All of these variables should be defined as extern fields. "vers" should zoom to ttadv1511m000. When you exit from the zoom session (ttadv1511m000), the other fields (rele & cust) will automatically be filled.

Here is the reference (http://www.baanboard.com/baanboard/showthread.php?t=54116) discussion.

- George

MilindV
30th October 2008, 16:29
Hi,

I hope this will be helpful.

To get Table-module(cmod) and code(flno) fields together(mmm999 format) after zooming out from standard session of Table Definitions(ttadv4520m000).

(Normally we get the single field after we zoom out from session as mentioned in field properties.)

Name your form-fields as table.f and table.t, zoom session will be standard session of Table Definitions(ttadv4520m000) and specify module(cmod) field as return field in field properties. This also return table code along with module.

Hitesh Shah
31st October 2008, 05:25
Another simple way to get the table code in ppmmnnn format without hardcoding the form field names is to zoom to ttadv3584m000 . And it will return the table code without any zoom return fields .

george7a
20th January 2009, 12:49
There are some undocumented clipboard functions in otgbrgtools DLL:

copy.to.clipboard
function extern copy.to.clipboard(
const string tag(),
const string mss() )

clear.clipboard
function extern clear.clipboard(
)


cut.to.clipboard
function extern cut.to.clipboard(
const string tag(),
const string mss() )


paste.from.clipboard
function extern paste.from.clipboard(
const string tag(),
ref string mss() )


Here is the full otgbrgtools DLL function:

function extern check.perm.lang(
domain ttaad.clan x,
ref long y )

function extern check.perm.mod(
domain ttadv.cmod x,
ref long y )

function extern check.perm.owner(
ref string x(),
ref long y )

function extern clear.clipboard(
)

function extern copy.to.clipboard(
const string tag(),
const string mss() )

function extern long create.path(
ref string path(),
long gmes )

function extern cut.to.clipboard(
const string tag(),
const string mss() )

function extern delete.menu.data(
domain ttaad.clan clan,
domain ttadv.cpac cpac,
domain ttadv.vers vers,
domain ttadv.rele rele,
domain ttadv.cust cust,
domain ttadv.cmod cmod,
domain ttadv.cmen cmen,
domain ttadv.parm parm,
domain ttyeno also.texts,
domain ttyeno also.objects,
[ long ignore.presence.of.linked.languages ] )

function extern long display.stp.info(
long newwindow,
long type,
long button,
const string msg(),
... )

function extern dsk.ds2font(
const string fontds(),
ref long weight,
ref long slant,
ref long points )

function extern dsk.font2ds(
long weight,
long slant,
long points,
ref string fontds() )

function extern long dsk.load.font(
const string fontds(),
ref long width,
ref long height,
ref long baseline,
ref long charwidth )

function extern get.envpath(
domain ttadv.vers v,
domain ttadv.rele r,
domain ttadv.cust c,
domain ttadv.kord k,
domain ttadv.cpac p,
domain ttadv.cmod m,
string s(9),
domain ttaad.clan l,
long vr )

function extern get.home.dir(
)

function extern getbseenv(
ref string bsepath(),
ref string systemname() )

function extern iadv0002.read.perm(
)

function extern long iadv0007.integration(
domain ttadv.cpac cpac )

function extern long iadv0007.integration.including.tt(
domain ttadv.cpac cpac )

function extern long iadv0007.pvrc.in.pvrc(
domain ttadv.cpac component.cpac,
domain ttadv.vers component.vers,
domain ttadv.rele component.rele,
domain ttadv.cust component.cust,
domain ttadv.cpac current.cpac,
domain ttadv.vers current.vers,
domain ttadv.rele current.rele,
domain ttadv.cust current.cust )

function extern long iadv0300.dept.vrc(
ref string cpac(),
ref string from.vers(),
ref string to.vers(),
ref string from.rele(),
ref string to.rele(),
ref string from.cust(),
ref string to.cust() )

function extern long iadv0300.label.vrc.changed(
ref string clan(),
ref string cpac(),
ref string clab(),
long leng,
long lhgt,
long depth.vrc )

function extern long iadv0300.message.vrc.changed(
ref string clan(),
ref string cpac(),
ref string cmes(),
long depth.vrc )

function extern long integration.on.runtime(
domain ttadv.cpac cpac )

function extern long itttxt0008.determine.factor(
ref long multi.byte )

function extern long itttxt0008.multi.byte.input(
)

function extern paste.from.clipboard(
const string tag(),
ref string mss() )

function extern read.last.used(
ref string x() )

function extern read.rel(
)

function extern read.tt.par(
)

function extern reset.compnr(
)

function extern long search.path(
domain ttadv.cpac cpac fixed,
domain ttadv.vers vers fixed,
domain ttadv.rele rele fixed,
domain ttadv.cust cust fixed,
domain ttadv.kord kord,
ref string path() )

function extern set.compnr.0(
)

function extern strip.envpath(
ref string envpath(),
ref string home.dir() )

function extern long test.dir(
domain ttst200 path )

function extern long test.or.make.dir(
ref string path.buff(),
long gmes )

function extern write.last.used(
string x(250) )

function extern string zoom.to(
const string session(),
... )

george7a
30th July 2009, 12:50
BMS (http://www.baanboard.com/programmers_manual_baanerp_help_functions_interprocess_communication_bshell_overview) variables that are declared in standard sessions are not documented. Here is what I have found until now about them:

1) A predefined variable called "bms.sender.process" (long) and it contains the pid of the session that sent the message.
2) A predefined variable called "bms.sender.command" (long) that I am not sure what it is used for.
3) A predefined variable called "bms.sender.argument" (long) that I am not sure what it is used for.
4) A predefined variable called bms.answer(1) (string fixed based) that I am not sure what it is used for.

I will update this list when I find more about this issue.

- George

george7a
3rd August 2009, 09:58
This post (http://www.baanboard.com/baanboard/showpost.php?p=7971&postcount=6) talks about a useful function the can select or multi-select files and folders from your Baan server.

In the otgbrg0019 DLL you can find the following function (or something similar):

function extern long select.file(
domain tgfile path,
long multi.select.allowed,
ref string selected(,) fixed,
ref long no.of.selected,
long max.selected,
[ long only.directories ] )


Make sure you check (bic_info) the exact function definition on your server before you use it.

vamsi_gujjula
11th September 2014, 12:32
Mentioned in the Program guide under edit$

Starting with TIV level 1640 the thousend separator and decimal sign can be overruled with the function
set.numformat.symbols(string decimal(1), string grouping(1) ).
The function reset.numformat.symbols() reverts to the normal behavior.

bhushanchanda
30th September 2015, 11:35
Some more -

1.
string release(10)
release = bshell.release$()

Gives you the bshell release number.

2. terminate.bshell()

Name says it all :D

3.
string portset(10)
portset = bse.portset$()

Gives you the porting set number

4. Socket functions still compile in LN but are not documented in latest Prog Guide
http://www.baanboard.com/programmers_manual_baanerp_help_functions_interprocess_communication_cross_platform_sock_connect

5. You cannot use variable name as daynr1 or daynr2
(Atleast not in few versions of LN)

6. From ttdlldesc

A.
function extern domain ttdesc80 get.form.description.of.session(
domain ttaad.clan clan,
domain ttadv.cpac cpac,
domain ttadv.vers vers,
domain ttadv.rele rele,
domain ttadv.cust cust,
domain ttadv.cmod cmod,
domain ttadv.cses cses )

pre True
post True
return Form description of the session specified by the parameters;
"" if form description of session could not be found.

B.
function extern domain ttcdes get.table.desc(
domain ttaad.clan clan,
domain ttadv.cpac cpac,
domain ttadv.vers vers,
domain ttadv.rele rele,
domain ttadv.cust cust,
domain ttadv.cmod cmod,
domain ttadv.flno flno )

pre True
post True
return Table description specified by the parameters;
"" if table description could not be found.