April 19, 2024, 01:19:07 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Error in the way Cb is responding

Started by TexasPete, November 17, 2010, 06:17:40 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TexasPete

It appears that CB is running down the main handler routine and performing each task under each "case Number" . This is causing it to hang. I am going to install cb 1.15 on an XP operating system to see if it behaves the same way.

Any suggestions of comments would be appreciated. Graham I did take note of your suggestions the other day.

Thanks everyone
Texas Pete

TexasPete

November 17, 2010, 06:41:38 AM #1 Last Edit: November 17, 2010, 05:06:02 PM by TexasPete
Ok , I checked the same program running cb 1.15 on XP . Guess What . It started working properly. Does any one have any ideas to make it work properly on windows 7. I have already turned of the firewall.
It appears that windows 7 does not like my program.
Thanks
Texas Pete

LarryMc

Pete,
This topic contains two post both by you.
Forget everything else you know.

Read your two post.  Do you think you have posted enough information for someone to look into helping you?

It might be enough for others but it isn't enough for me.  But it might be just me.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

mrainey

QuoteBut it might be just me.

No, it's not.
Software For Metalworking
http://closetolerancesoftware.com

LarryMc

Hey Mike,

I didn't mean to start a "let's beat up Pete" thread  ;D(although, on second reading of my post, it kinda sounds like it) ;)

My point is I like to try and help people when I can but I need a little something more to work with.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

TexasPete

Flellas, You are both right , I know it is not enough. I simply don't know what to post. The folder for this program is 2. 7 mbs. I am trying to write a small program that will duplicate what is happening that can be posted.

Thanks for you patience. I am happy to email the folder is you want the whole thing. This thing is eating my lunch.

Thanks
Texas Pete

TexasPete

November 18, 2010, 07:41:52 AM #6 Last Edit: November 18, 2010, 08:16:56 AM by Larry McCaughn
Ok fellas if anyone would like to help. I have uploaded the entire folder to my web page for down Load. All source is there . I have remarked the offending code well. At least what I think the offending code is.
To me it appears that Select endselect is not working in cb1.5. This code does work in cb 1.01. I have remarked out all the gosubs in the handler routine. The buttons that worked in CB 1.01 are remarked that they worked in cb 1.01.  I hope it is not something easy and I feel stupid.

You can access the code at here

Thank all of you for your patience.

Texas Pete
Ye Ha! Get me riding again!

LarryMc

I'm not absolutely sure but I think you are missing an if statement in each of your case statements.

you have
SUB main1
   SELECT  @CLASS
      CASE @IDCONTROL
         Select @CONTROLID
            CASE 1
               gosub NewPage
            ......
         ENDSELECT
   ENDSELECT
what you need, I believe, for each case is this
SUB main1
   SELECT  @CLASS
      CASE @IDCONTROL
         Select @CONTROLID
            CASE 1
               if @notifycode=0   <<====== which signifies a button is pressed
                  gosub NewPage
               endif                    <<======
            ......
         ENDSELECT
   ENDSELECT


LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

TexasPete

Larry , I will try that and see how it works. Why did it work without them in version 1.01

Texas Pete

LarryMc

November 20, 2010, 07:08:16 PM #9 Last Edit: November 20, 2010, 09:38:26 PM by Larry McCaughn
TP
I loaded your program into v1.15 on my xp machine and did some playing around.

First off, understand that I have no idea what Paul changed internally with this version.
2nd, what I am going to describe is what I see running your program on my computer, meaning I can't swear this
is what everyone else might see.

Trying to run it as I downloaded, it crashed.

Here's what I know about how windows handles button notification messages:
These are the notification messages windows sends regarding activities involving buttons:
CONST BN_CLICKED = 0
CONST BN_DBLCLK = BN_DOUBLECLICKED
CONST BN_DISABLE = 4
CONST BN_DOUBLECLICKED = 5
CONST BN_HILITE = 2
CONST BN_KILLFOCUS = 7
CONST BN_PAINT = 1
CONST BN_PUSHED = BN_HILITE
CONST BN_SETFOCUS = 6
CONST BN_UNHILITE = 3
CONST BN_UNPUSHED = BN_UNHILITE


I did some trapping and what was happening with the approx 50 buttons you have defined is that when the screens were being built and/or you moved the mouse around the BN_PAINT message was being sent multiple times to each of the buttons.
Since you did not have the IF @notifycode =0 on EVERY button (0 = BN_CLICKED ) the program went off in to never-never land.

If I remember right you said you put the if @notifycode on some buttons but still had problems.  That's because you didn't do it to all the buttons.  The fact that some routines caused problems and some didn't can be to due to whether or not they caused the screens to be changed triggering  paint notifications.

I was also get some other crashes until I changed the button control definition states so the captions were blank as the help file said concerning bitmap buttons.  That seemed to cure that problem.

So, again, I have no idea what was changed internally.  The above is what I saw and did to improve the situation.

As a side note, people are always asking what is different between CBasic and IWBasic.
In checking out your problem I discovered some things that I really miss when trying to use CBasic:

1. selecting a keyword and pressing F1 doesn't open up the help file
2. if I select a word and then do a CTRL-F to search for that word it isn't automatically inserted as the search term.
 I have to highlight the word, CTRL-C,  CTRL-F, and CTRL-V to load the search term
3. The search function only searches DOWN and while the search dialog is open you can't reposition the caret to another position in the file. You have to close the search dialog, move the carent, CTRL-F and CTRL-V(since the search term isn't saved).
4. There is no "find in files" feature to search in other places for similar code/terms.
5. I can't select a block of code and use TAB and SHIFT_TAB to move the entire block left or right.

I've gotten really spoiled to these features in IWBasic.

Anyway, hope this helps you a little.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

GWS

Ooh ! .. criticism ..  ;D

For searching / replacing, use 'Edit - Find'.  It is a simple system, but it works fine.
You can use Cntl-C and Ctrl-V with the dialog box to find required words and phrases.

Selecting a block of code and using TAB and SHIFT_TAB to tab the entire block left or right, works for me .. I use it a lot ..

best wishes, :)

Graham




Tomorrow may be too late ..

aurelCB

November 21, 2010, 09:41:10 AM #11 Last Edit: November 21, 2010, 09:43:18 AM by aurelCB
Philip made complet mess in coding.
I spend last night one hour on looking into his work.
idea is not bad but he made to many mistakes.
Only solution which i see is COMPLET rewrite step by step...

LarryMc

Quote from: GWS on November 21, 2010, 05:38:12 AM
For searching / replacing, use 'Edit - Find'.  It is a simple system, but it works fine.
You can use Cntl-C and Ctrl-V with the dialog box to find required words and phrases.
But that's my point Graham, I'm use to NOT having to use Cntl-C and Ctrl-V when finding something or having to type it in.

Quote from: GWS on November 21, 2010, 05:38:12 AM
Selecting a block of code and using TAB and SHIFT_TAB to tab the entire block left or right, works for me .. I use it a lot ..
Strange, it doesn't work in my community edition or version 1.15.
When I highlight a block of code and hit tab all it does is unselect the first character in the selected block of code.

Yet, it works fine in all my versions of IWB/EB.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

whitenite1

Larry..

  After reading these posts, I thought I'd try it out on my computer. I hi-lighted a section of code, pressed TAB, and, yes, the whole block that was hi-lighted, shifted to the right. SHIFT_TAB moved it left. I'm using Creative BASIC 1.153. I also use XP.

whitenite1

GWS

Larry,

QuoteI'm used to NOT having to use Cntl-C and Ctrl-V when finding something or having to type it in.

.. well it is nice to just press F1 for help. but I quite like the no-nonsense way of using 'Edit-Find' .. not as neat as F1 of course, but I like it ..  ;D

I can't imagine why Tab and Shift-Tab aren't working for you - never known them not to work for me - mind you I'm using Version 1 and XP.

best wishes, :)

Graham




Tomorrow may be too late ..

LarryMc

Graham,

I know it's odd. The TAB thing doesn't work for me with either ver 1.0 OR 1.15 of CB on my XP machine.

As for the Edit/Find thing.  It's not just the F1 thing for help.
To find something (on my copies of CB anyway) I have to either CTRL-C / CTRL-V or type what I want to find.
I also can't make it search backwards.

All my comments were merely a statement of my observations of differences I found between IWB and CB and the fact that I am spoiled to the way IWB works in those areas.

It was not an "attack" on CB which I know how dearly you love and have suffered for. ;)

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Rock Ridge Farm (Larry)

I will look at CB but it will not be soon.
The code that is there is where Paul left it when he gave up on Cbasic.
Trying to get IWBasic 2.0 ready for release and working lots of hours at my day job.


Larry

GWS

Larry M,

I know .. just teasing ..  :)

Larry S,

Look forward to that Larry .. make sure you have a good stock of headache pills before you take a look ..  ;D

Considering there's no documentation, it would be amazing if you could figure it out ..

best wishes, :)

Graham
Tomorrow may be too late ..

Egil

This is not meant as any kind of criticism, but after playing around with Creative Basic for several years, trying to learn how windows behaves, my personal experience is that there is absolutely no errors in the way CB is responding.
But CB always responds to errors made by myself! ::)

Isn't that the way it should be??
Support Amateur Radio  -  Have a ham  for dinner!

TexasPete

November 23, 2010, 08:30:32 AM #19 Last Edit: November 23, 2010, 08:39:54 AM by TexasPete
Egil, I am a big enough man to always admit my ignorance. So far, in my experience it is generally something the author did not explain well. At least for me anyway. Or there was a bug or a caveat. While I programed with several of the different dialects of basic. I have over the years found bugs in every one. I am of the opinion , That there is no such thing as bug free program. If there was'nt a bug in the program itself , there was a bug in microsoft's code.  I remember one bug documented over the internet in the scrolling graphics routine. I had to program around that one and eventually did so.

Any way, I am aware of the fact that most of them are me!!. There was something I forgot or I didn't understand. This has been a learning experience for me. The more I program the language and understand it, the more I like it. I see many of it benefits over previous languages that I have played with over the years.

One thing that would help me is a better debugger. Error messages that to me are ofter cryptic. This week I got an error message saying that variables were not defined. I was looking right at the code were it was defined. I can't explain it , But this is what  I actually experienced. It did not happen once but several times. What caused it I don't know.

Thanks
Always for your help.

Texas Pete

GWS

TexasPete,

I'm afraid your viewpoint is all wrong.  Take for example, your wording of this thread's title .. it should read 'My program is not functioning as I expect'.

Do you see the difference?

Now you're telling everyone you've found 'bugs' in every dialect of Basic you've ever tried - including Microsoft software.  That does seem a little unlikely don't you think?

In fact, whether you'd used Basic or Fortran or Delphi or Algol or C or any other language, you would, I think, have experienced what you always insist on calling 'bugs'.

They are not.  If you write code that has severe logical inconsistencies, the programming system will often throw it's hands up in dismay and be unable to offer a sensible message.  But always trying to be helpful, the computer will offer some cryptic comment - more in the nature of a clue as to what it thinks is wrong.  That's not a 'bug' - it's a last gasp attempt from the computer's point of view to say something it thinks might be useful.

So you might well get a 'variable not defined' message at a line where the variable does not appear.  It just means the compiler is hopelessly confused.  But what you can be sure of, is that there is a serious error in your code somewhere, not necessarily at that line unfortunately.

You then need your Sherlock Holmes kit to search out what the error in your code actually is.  No programming system so far written can ferret out what you really meant if the code is fundamentally wrong.

Egil is right, Creative is very reliable. Any errors which it reports are almost certainly caused by your own code.

The only thing I can suggest, is that you try working on one or two smaller programs, to prove to yourself that the system is working fine.

best wishes, :)

Graham
Tomorrow may be too late ..

aurelCB

Yes Graham is right...
You first must crete all windows which you are plan to use.
Properly set every style for each window.
Write step by step each window subroutine.
Put every routine in separate SUB then you can list rutine in upper combo
and search what is where.
etc...etc...

And yes Creative basic is probably language without knowing bugs for me... ;)

Egil

November 23, 2010, 12:08:29 PM #22 Last Edit: November 23, 2010, 12:13:39 PM by Egil
Texas Pete,
I really didn't want to offend you or anyone else with my comment. If I did, I really appologize.


For many years, I used to do programming for a living, using C and assembler. But gradually my work shifted to electronic maintenance, and later to teaching.
When I retired a few years ago, I hadn't been programming for 20-25 years, and never did anything for Windows.
But remembering all the fun I once had by programming, I started using EB and CB as a hobby.
Everything I once knew about programming had been forgotten, so I had to start from scratch. And frankly, I still have a long way to go.

But there was just one little detail I remembered though, an advice I once got from a teacher:

Do all your programming in modules, test every subroutine separately, or in groups of subroutines that relates to each other.
When all the subroutines are tested this way, it becomes a less painful task to bring them together in your final "masterpiece".

I guess remembering that piece of advice have saved me from a lot of frustration through the years.
Maybe that method will work for you as well??


All the best!
Support Amateur Radio  -  Have a ham  for dinner!

TexasPete

Yes Egil,  You are absolutely right. I generally will write a subroutine separately and test it to see  if it works out of the program before I install it into code. The program that I am translating was written in about 11 or 12 separate modules but eventually you have to bring them together to see the orchestra work. I admit that I have my own way of doing things. I do all the things you talk about to varing degrees.  What this boils down to is individual style.  I personally would like to study each programmers habits of work. I think it would be interesting. I wish I could see each one work and program for a week.  One time I took a program I wrote to someone who was supposed to be a professional programmer. He looked at six lines of my code and could not figure out what I was doing. I thanked him, paid him for is time.  The code that I showed him actually worked on the computer. It did exactly what it was designed to do. It just was not his "style"

Anyway, I hope everyone has enjoyed this discussion.
Always willing to learn,
Texas Pete

aurelCB

Philip
Style of programming is one thing and functionality of program is another part of story.
I can for example write your program that you cant recognize your own code.
Its not problem in this.
but like i said before on this way like you write program you simply cannot find on easy way what you do wrong.
I hope that you understand me....

Aurel