Trying to get around using File I/O in scripting bridge.

Discussion about software products provided for the BR community and created by its members. This includes (but is not limited to): MyEdit, File IO, Screen IO, FNSnap, and Utilities written in other languages for use with Business Rules.

Moderators: Susan Smith, admin, Gabriel

James Lowman

Trying to get around using File I/O in scripting bridge.

Postby James Lowman » Tue Jan 05, 2010 7:38 am

I have look at the Select.brs program and added two lines:

10294 OPEN #5: "NAME=bridgetest.ida, replace,recl=128, KFNAME=bridgetest.idx, KPS=1,KLN=5",Internal, Outin,keyed
10296 Close #5

Now the bridge see's this and will quit. It works in BR but not using the Scripting Bridge, why? and how do I fix this seemly easy task?

Jamie Lowman

Mikhail
Posts: 82
Joined: Tue Jul 07, 2009 10:26 am
Location: Ukraine

Postby Mikhail » Tue Jan 05, 2010 9:09 am

Find settings.php.


In it, set $config['leavetmp'] = true


This way if your code gives an error, then it will be in your .ERR file in the BR directory (the one used by the bridge)

bluesfannoz
Posts: 238
Joined: Fri Jun 19, 2009 9:01 am
Location: Topeka, Kansas
Contact:

Postby bluesfannoz » Tue Jan 05, 2010 9:22 am

I believe that option is already on. So you need to look in the that err file that is created.

Check and make sure this index file exists.

Also if you copied your code exactly then your

close #5 needs a colon after it close #5:
Steve Koger
Computer Specialist
SEKESC-MACS Division

Chris Shields
Posts: 22
Joined: Thu Aug 06, 2009 12:19 am

Postby Chris Shields » Tue Jan 05, 2010 10:24 am

All i see wrong is that missing colon.

Also load and save the source in BR just to make sure you have any compile time errors.

You also need to run BR and proc the '.prc' files. That way you can debug at run-time.

As for the '.err' file, it is produced by BR's "stderr" output. The problem is that unattended mode produces it's own error whenever an error is encountered and BR goes into ATTN mode. So this overwrites anything useful in this file.

The logging files produces by BR's logging facility don't apparently produce anything to indicate the errors produced by a program so really there is no way to identify an error without writing your own error handlers or running the process in 'attended' mode.

I wish there was some way to log all errors to a file. If someone knows how to accomplish this I would like to know.

Gabriel
Posts: 354
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

Postby Gabriel » Sun Feb 26, 2012 1:11 pm

I wish there was some way to log all errors to a file. If someone knows how to accomplish this I would like to know.


Chris,

I wonder if it would be possible to modify the program that the Bridge generates to have a statement at the beginning such as:

On Error goto BridgeErrorHandler

and include a BridgeErrorHandler function that writes the error number and line number to another debug output file.. That way if there's an error we could check that file to see which one it is instead of running the .prc file in attended mode to see it.

It would also be nice if the latest proc file had a standard name .. after creating it you could automatically copy it to testbridgecall.prc or something so that we can easily rerun the last test without having to look in Windows Explorer to see which one was the last one.

Ideally if we combine both of those ideas, then the real generated proc file would have the Error Handler and the test copy (testbridgecall.prc) would be missing the error handler.

This would make it easier to debug bridge programs.

Gabriel

admin
Site Admin
Posts: 14
Joined: Tue Jul 08, 2008 11:28 pm

Postby admin » Fri Mar 02, 2012 4:42 pm

Good idea. Let's try to do that next time we are at the office.


Return to “3rd Party Software from the BR Community”

Who is online

Users browsing this forum: No registered users and 1 guest

cron