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

Post Reply
James Lowman

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

Post by James Lowman »

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: 87
Joined: Tue Jul 07, 2009 10:26 am
Location: Ukraine

Post by Mikhail »

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: 291
Joined: Fri Jun 19, 2009 9:01 am
Location: Lawrence, Kansas
Contact:

Post by bluesfannoz »

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

Post by Chris Shields »

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: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

Post by Gabriel »

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

Post by admin »

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