rahul.kolhe22
5th November 2008, 15:25
Hi all,
In Baan LN I am able to compile the script using the function:

"compile.source" in the dll "ttcctdll.comp"

But this dll is not present in Baan4c4. I get the error

Cant open DLL 'ottcctdll.comp' for reading

Can any one tell how can I do it in Baan4c4.

Thanks in advance
Rahul

george7a
5th November 2008, 15:43
Hi,

I am not familiar with a baan4c4 function that does compile. However, there is the standard command "bic6.1" (found under $BSE/bin) that compiles. There are some examples in the forim, here is one:
http://www.baanboard.com/baanboard/showthread.php?t=1252&highlight=bic6.1+compile

I hope it helps,

- George

_Ralph_
6th November 2008, 21:38
doesnt expr.compile() exists on Baan IV?

george7a
7th November 2008, 09:25
expr.compile() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_expressions_runtime_expr_compile) compiles the specified expression but not the whole code. Moreover, it won't create a compiled object.

- George

rahul.kolhe22
7th November 2008, 11:11
Hi George,
1. The first thing is I cannot find bic6.1, but I could find bic file.
2. I tried using it to compile the code using the function run.prog(), but it returns me -1, i.e. cannot start the program.:(

Thanks
--Rahul

george7a
7th November 2008, 11:29
Hi,

1. Try to search the forum for bic+compile?
2. A. Did you try the command manually. Did it work?
2. B. Post the script you were trying using run.prog.
2. C. Is your Baan4c4 on Windows/UNIX?

- George

rahul.kolhe22
7th November 2008, 11:40
Hi,

2.A.] I tried to execute the command manually but it is giving me the BW message as "Can't read session or object (bic.exe)"
2.B.] Here Package of my script is "tc", module is "com" and script name is "999999"
ret = run.prog("bic.exe", "ptccom9999990 -o otccom999999 -pacc B40CMigr", RP_WAIT)
Now I have tried modifying the code it is now returning me 1
2.C.] My Baan4c4 is on Windows

Thanks in advance
--Rahul

george7a
7th November 2008, 12:01
2.A bic.exe is a windows process. go to the server and run it there fro command line manually and let me know what happens.
2.B The first thing I noticed is that you should put the full path of bic.exe ($BSE/bin...)

rahul.kolhe22
7th November 2008, 13:01
Hi,
I tried executing the command manually on the server but it is giving me the error. The error is as follow:

bic: User file for user 'baan' does not exist. Last searched location '${BSE}/lib/user/ubaan;${BSE_REM}!${BSE}/lib/user/ubaan'
bic: Current user is not a valid Baan user.

Hitesh Shah
7th November 2008, 16:40
Here is a sample function working for compiling . Use it with approriate modifications .


domain tcmcs.s999 argstr,whrusd
long ret,fsize ,compnm
compnm = get.compnr()
| if choice =51 then
| optfl = rptfl
| endif
file_path = file_path & "0"
switch.to.company(0)
nogenerror = true
| if nogenerror then
whrusd= creat.tmp.file$(bse.tmp.dir$())
errfl = creat.tmp.file$(bse.tmp.dir$())
| argstr = file_path & " -d ottstprepdll:otudllchm000001 -u -f "
| argstr = file_path & swtch & chr$(100) & sp & dllnms & swtch & chr$(117) & swtch & chr$(102) & sp |HS .o 7MAR2003
| argstr = file_path & swtch & chr$(100) & sp & dllnms | HS .n 7MAR2003
argstr = file_path
& swtch & chr$(117) & swtch & chr$(102) & sp
| argstr = argstr & whrusd & " -o o" & tudll960.cpac & tudll960.cmod & strip$(shiftl$(tudll960.crep)) & tudll960.lang
#if DEBUG
argstr = argstr & whrusd & swtch &chr$(108)& chr$(111) & sp & chr$(111) & "tudll" & strip$(shiftl$(tgnam))
#else
argstr = argstr & whrusd & swtch & chr$(111) & sp & chr$(111) & "tudll" & strip$(shiftl$(tgnam))
#endif
| argstr = argstr & " -qe " & errfl
argstr = argstr & swtch & chr$(113) & chr$(101)& sp & errfl
| ret = run.baan.prog("bic" , argstr , RP_WAIT)
ret = run.baan.prog(bc , argstr , RP_WAIT)
if not file.stat(errfl,fsize) then
| message("Error file is not generated while generating the report")|Dipen 17.4.2003
| nogenerror = false |Dipen 17.4.2003
endif
if fsize > 1 then
print.error.report()
endif


Further ottdllobject has compile.library and compile.report separate functions in Baan IV . U may try that .

rahul.kolhe22
10th November 2008, 08:32
Hi,
Thanks to George and Hitesh Shah for your valuable suggestions.

Finally I am able to compile the script in Baan4c4 through the program. The same command is now working (mentioned below). Why I dont know?
run.prog("bic.exe", " ptccom9999990 -o otccom999999 -pacc B40CMigr", RP_WAIT)

If I come to know about the reason I will surely add it to this thread.

Thanks
Rahul