Page Index Toggle Pages: 1 [2]  Send Topic Send Topic Print Print
Hot Topic (More than 10 Replies) How do I xlookup a Q&A dtf database? (Read 6179 times)
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: How do I xlookup a Q&A dtf database?
Reply #15 - Aug 16th, 2004 at 3:50pm
Print Post Print Post  
A note about this will be added to the workarounds page. I will make sure that the documentation gets updated.

As to your advice on how to fix this. It isn't nearly so simple. We use centralized routines to access external databases. These routines are used by all of the "X Commands" and thus cannot differentiate the files by extension. Additionally, it is good practice to minimize the use of file extensions to differentiate file types, especially since we support OSs that do not necessarily use them outside of the HTML browser. So, in place, we use the file header embedded in the .db, .dat, .dsr. ddt files and the file name to match file types.

The bug itself was quite specific to the handful of commands that were added to extend XLookup, in that XLookup itself does not close a an open database until it is certain there will be no further XLookups. When you continued to call XLookupSourceListAll after it had returned a failure, it failed to mark that while that database file was open it had not successfully loaded.

The bug is now fixed. As I mentioned in my last post, the fix will be in the next release.

As a workaround, do not use the commands listed above on Q&A files. If you do, please make sure that you check both the @error (every time!) and check the log file for problems before you deploy on any data that you cannot easily replace. If an @error does occur, do not continue calling any of the extended "X Commands".

If you can't help yourself and do mess up a Q&A file. The repair for that file is trivial and outlined above. I only mentioned the fix because you described your file as "critical" and I wanted to make sure you understood that the file was easily recoverable and that there has been no loss of data or structure.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: How do I xlookup a Q&A dtf database?
Reply #16 - Aug 16th, 2004 at 3:56pm
Print Post Print Post  
Thanks again Mark.

Also for reference about this issue:  Although there was a message in the log, I did not receive a message as a user, so there was no real visible indication to anyone that an error had occured.  Just wondering if those types of errors should be flagged visibily in addtion to being recorded in log.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: How do I xlookup a Q&A dtf database?
Reply #17 - Aug 16th, 2004 at 4:03pm
Print Post Print Post  
Quote:
Just one more small clarification re XPost, XPostR.:

You list 6 commands in lower section that summarizes, Only Supports Sesame Files

But in the section near the top where you list 4 exception files:
XPost and XPostR did exist in Q&A, but are not listed there.


The list at the top is specifically labelled as those X commands which did not exist in Q&A. As XPost and XPostR did exist in Q&A, they are not on that particular list. The list at the bottom lists all the X commands and which type of file they support regardless of where they originated. 

Quote:
Doesn't that mean that they should be listed in the group that work in both Sesame and Q&A?  But they are shown in the group that does not work with Q&A.  This conflicts with the earlier statement.

No, because they do not work with Q&A. Only those X commands that read were ever supported for Q&A files. XPost and XPostR write, and were never supported. See page 124 of the Programming Guide.

Quote:
So is the final summary at the bottom of the posting, Only Supports Sesame Files, the correct listing and the earlier comment was not correct?

Both are correct.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: How do I xlookup a Q&A dtf database?
Reply #18 - Aug 16th, 2004 at 4:08pm
Print Post Print Post  
Quote:
Thanks again Mark.

Also for reference about this issue:  Although there was a message in the log, I did not receive a message as a user, so there was no real visible indication to anyone that an error had occured.  Just wondering if those types of errors should be flagged visibily in addtion to being recorded in log.


We set @error for that purpose. The logged messages as generated by SBasic programming are intended for the programmers not the end-users. We give the programmers access to @error to encourage them to pass on any error message they may deem appropriate to their end-users without having to suppress the (usually technical) error messages their program may generate at runtime.

In other words, Sesame leaves it up to the programmer which errors they want to presented to the end user, and how they want them presented.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: How do I xlookup a Q&A dtf database?
Reply #19 - Aug 16th, 2004 at 6:35pm
Print Post Print Post  
I can accept that, my problem, could have used an @error with message box.  But can you provide any guidelines about using that?  Certaily impractical to use it after every line of code.

I can see using it after every "X" type of command.
I can see using it after  every shell/macro commands.
I can see using it after  every I/O commands with files.

What about sub routines?. Do we use @error at the beginning or end of a subroutine, or pick and choose particular  lines within the subroutine? 
How about array processing?  Loops?

Can we use a generic error trapping routine on any Form Event to handle all code on that form?

Hoping you can provide some guidelines about what types of commands are more likely to generate messages?



  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: How do I xlookup a Q&A dtf database?
Reply #20 - Aug 16th, 2004 at 6:56pm
Print Post Print Post  
Use @error after any SBasic command where you would have your code do something different if the SBasic command fails.

@Error is only applicable to those SBasic commands that could be described as built in subroutines or functions. So SBasic statements do not affect @error, nor do variables, loops, and other control contructs.

I can't give you a list of the SBasic commands that log errors. Most of them do not themselves log errors, the engine or the user interface generates the logged error. Any command that accesses data (of any kind) or accesses the user interface (in any way) may generate a logged error. Most logged errors (that ever actually happen) are not nearly as serious as the conditions that cause @error. Many are merely informative. There are total of 884 of these messages that Sesame can generate. Most of them are static, built-in error messages. About 100 are dynamically produced errors.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send Topic Send Topic Print Print