Author |
Topic: Will PROC_transpose(A$(), B$()) work ? (Read 1157 times) |
|
Edja
Developer
member is offline


Posts: 60
|
 |
Re: Will PROC_transpose(A$(), B$()) work ?
« Reply #8 on: Mar 22nd, 2015, 4:31pm » |
|
The plot thickens ... I've extracted the relevant parts of my program into a smaller one and executed this. The message "Type mismatch" now appears as it should. BB4W clearly behaves correctly. I must have introduced an error somewhere else in my original program. I'll try to narrow down what type of bug I've created and let you know. It may take a few days.
Eddy
|
|
Logged
|
|
|
|
rtr2
Guest
|
 |
Re: Will PROC_transpose(A$(), B$()) work ?
« Reply #9 on: Mar 22nd, 2015, 5:12pm » |
|
on Mar 22nd, 2015, 4:31pm, Edja wrote:| I must have introduced an error somewhere else in my original program. I'll try to narrow down what type of bug I've created and let you know. |
|
As a first step, make sure that there's just one ON ERROR statement, at the beginning of your program, which looks like this:
Code: ON ERROR SYS "MessageBox", @hwnd%, REPORT$, 0, 0 : QUIT The right-click (or Shift+F10) context menu will list ON ERROR statements, but only if they are at the start of a line (and only if you've enabled them in the Customize dialogue) so you can't guarantee to find them that way.
Richard.
|
|
Logged
|
|
|
|
Edja
Developer
member is offline


Posts: 60
|
 |
Re: Will PROC_transpose(A$(), B$()) work ?
« Reply #11 on: Mar 25th, 2015, 11:14am » |
|
Quote:| I must have introduced an error somewhere else in my original program. I'll try to narrow down what type of bug I've created and let you know. |
|
I 've tried to reproduce the problem starting from my original program but in the process of making many changes to the code I must have corrected my error without even being aware of it. The program works fine. PROC_transpose gives "Type mismatch" if called with string arrays. I did have 3 instances of ON ERROR in different locations of my program that may have contributed to the wrong behaviour. I've corrected this as you advized.
And thank you(!) for updating PROC_transpose$ in ARRAYLIB to work with v6.00a. It worked first try.
Eddy
|
|
Logged
|
|
|
|
Edja
Developer
member is offline


Posts: 60
|
 |
Re: Will PROC_transpose(A$(), B$()) work ?
« Reply #12 on: Mar 25th, 2015, 1:26pm » |
|
Quote:| I must have corrected my error without even being aware of it. |
|
OK, I found an older version of my program with the same behaviour. The culprit was the following line ON ERROR PROC_comexit : QUIT
When I call PROC_transpose(A$(),B$()) control is given to the above line and PROC_comexit executes. BUT I forgot to execute PROC_cominit to initiate COMLIB. I suppose another error is then generated ....
When I remove ON ERROR PROC_comexit : QUIT control is given to another ON ERROR at the start o f my main program and the message "Type mismatch" correctly appears. In the end it had nothing to do with PROC_transpose$ but with my clumsy way of error handling. As said in my previous mail this is now corrected. Eddy
|
|
Logged
|
|
|
|
rtr2
Guest
|
 |
Re: Will PROC_transpose(A$(), B$()) work ?
« Reply #13 on: Mar 25th, 2015, 2:57pm » |
|
on Mar 25th, 2015, 1:26pm, Edja wrote:| ON ERROR PROC_comexit : QUIT |
|
You should never - at least not in any normal circumstances - have a (non-LOCAL) ON ERROR statement which doesn't report the error! Not only will any mistakes you introduce into the program yourself lead to an unexplained exit, but any unexpected error which happens when your end user runs the program will generate no diagnostic information to help you trace the problem!
Options for reporting the error are to print it to the 'main window' (but that can very easily be hidden by something in the foreground, or disabled) display it in a message box (my usual preference, because it's guaranteed to be visible), write it to a log file, or perhaps a combination of these.
Richard.
|
|
Logged
|
|
|
|
|