October 28, 2025, 12:30:20 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Cancelling a Project Build

Started by Andy, April 10, 2015, 05:30:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

Hi,

Just one question - when you build a project, is there a way to stop the build when you see an error in one of the source codes?

I have 7 .iwb files that make up a project, and It's mainly just one I modify - and that's where any errors will be.

So if I see an error during compilation - can I stop the build?

Currently, it's taking around 3 to 4 minutes to compile.

Regards,
Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

LarryMc

Andy
Right now there is no way to stop it.

Are you using a stdafx.inc in your project?
There is a way to construct a project so that you compile the whole project once.
Then after that you only have to compile just the file you change as long as you don't change global variables.

With your program I can't TELL you how to do it.
You'd have to send me your entire program for me to modify me and set it up for you to so that.

The new IWB IDE has ~50 iwb files and I use that setup on it. As well as my other creations.

I'll also take a look see at the IDE to see what it would take to add an Abort function.  Seems like I looked into it before. The best I could do would be at the file level.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

Thanks Larry,

Just sent you the project files.

No I don't use that .inc file.

:)
Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

LarryMc

Andy
Which file is it you are mainly changing, AutoScan1752.iwb?
Also, is there any particular portion of the code you are having to change the most?

I've already seen a couple of places I can help you out in the way you are doing some things.

I just compiled for the 1st time.  If it is taking 3-4 minutes for you then you must have a really old computer.
My computer is a couple of years old win7-64 and it takes 45 secs to compile the whole thing.

Since your program is rather complicated(as I've said before) it may take me a few days to make the adjustments.
I sure don't want to break your code. I know how hard you have worked on it.
When I get through you will have more than 7 iwb files but I don't know how many just yet.

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

Andy

Hi Larry,

Yes AutoScan1752 is the one I mainly change.

The Setup compiles in just a few seconds, it's thr project175 that takes the time.

Thanks for having a look at the code, I'm okay with how ever many iwb files you may need, it's just the number of .exe files I'm trying to keep down.

I scan the .exe files online for false positive A/V alerts - and we all know about A/V giving false positives.

Anyway,
Thank you so much for having a look, and please don't rush!

Thanks,
Andy.
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

LarryMc

It was Project175.iwp that compiled in 45 secs on my computer.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

Andy
I think I stumble across a bug in your program that you need to take a look at and see if I'm correct.
In line 196 of "globals.iwb" you made 'x' a global variable.
In the sub LoadCodes you set it to zero and use it as an index for the
CodeIn[x]
DescIn[x]
arrays which is fine as you increment through.

Then you use x for a bunch of unrelated activities(and values like for vehicle makes).

The problem lies in when you call subs Code1,2,3 starting at line 2191 in "autoscan1752.iwb". You do not set 'x=0' prior to calling Code1() nor do set 'x=0' inside Code1() which means 'x' can be some random number initially.

I guess since you are doing a look-up later on the contents as opposed to the index it won't really matter if you are skipping the CodeInSpec[x]
MakeInSpec[x]
DescInSpec[x]

arrays
I think you need to simply put an x=0 at the start of the code1 sub.

speaking of these last 3 arrays. defining all 3 the way you have
STRING CodeInSpec[15000]
STRING MakeInSpec[15000]
STRING DescInSpec[15000]

takes up over 11 meg of memory
The 5 and 6 character CodeinSpec strings don't need 255+nul  space
And the MakeInSpec(carMake) don't need that much space either

Going with IStrings
ISTRING CodeInSpec[10,15000]
ISTRING MakeInSpec[20,15000]
STRING DescInSpec[15000]

which cuts the memory requirement down to a little over 4Meg

If you did that everywhere you addressed an element of the ISTRINGs it would have to be as
CodeInSpec[0,x]
MakeInSpec[0,x]
With newer computers memory tends not to be an issue but you went to a lot of trouble to make sure your program runs properly on XT computers.  Might be something you want to consider
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

Larry,

Thnaks for the advice.

I made the changes as you said, however the project build "seemed" to do nothing when it got to compiling Code1.iwb.

Looking in Task Manager - the iwbparse.exe was at 50 percent cpu usage and was up to 50,000K memory.

I waited around 5 minutes but then had to stop the build and change back the alterations in Code1, 2, 3, etc.

Can't think why that would happen.

My PC might be a bit on the older side, but everything else on my system runs pretty fast.

Anyway, look forward to any more suggestions.

Thanks,
Andy.

Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy


Noticed that I should use:

CodeInSpec[10,x]
MakeInSpec[20,x]

not:

CodeInSpec[0,x]
MakeInSpec[0,x]

Anyway, I have found a way (at least on my PC) to "stop" a project build.

It typically take my project around 25 seconds to stop with this program - thats with 7 iwb files in the project.

It forces an error whilst building, so the build will fail.

For me, it's much better than waiting minutes before the build falls over.

Anyway attached is the code...

Note: - this works on my PC, and I'm not saying it's perfect by any means and it's a bit rough and ready, but it does work for me.

To use it, I compile and put a desktop link to it, if the project has an error, I just double click this program.
After a few seconds the program will tell you how long it took it to stop the build.

Thanks,
Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

LarryMc

I've returned Andy's modified program to him. I was unsuccessful in my attempt to do what I wanted to do.
I told Andy I was going to explain here because I believe others can learn from this.  This also relates to the 'tutorial' I had started but never finished on creating and using 'projects'.

If you remember, this thread started because Andy didn't like having to wait 3-4 minutes for the compile process to finish when he knew early on that there was an error and the compile was going to fail.

First, why would it take 3-4 minutes to compile his project?
Andy's project has 7 iwb files.
The size of the files are(in # of lines)
32,886
18,366
23,053
20,613
  7,015
    615
    323
which by any measure is a lot of code.

The smallest file is Andy's globals.iwb file which is treated like both a src file and an inc file to the other source files. This is covered in the tutorial.  So far so good.

I had asked Andy if he was using a stdafx.inc file and he said no.  This is a special file that I had not yet covered in the tutorial.
After seeing how small Andy's globals.iwb file was I determined that the stdafx.inc wouldn't help him much anyway.

But to satisfy everyone's curiosity I'll explain its use.
At the top of each of Andy's iwb files(except globals.iwb) i replaced
$include "globals.iwb"
with
$include "stdafx.inc"
I create a file called 'stdafx.inc' and I put one line of code in it
$include "globals.iwb"

So what does this do for us.
Each time the project is compiled the compiler checks to see if any files(including nested files) contained in 'stdafx.inc'
have changed since the last time time a file named 'stdafx.pch' was created. (pch stands for pre-compiled headers).
If anything has changed the headers are recompiled otherwise the last good ones are used when linking.

It saved a lot of time on the IDE when I was working on it  but my 'globals' was much bigger.

So, that little technique wasn't going to be of any help.

Now, the build menu has menu options designed specifically to address Andy's problem.
When you have successfully compiled a project and you want to make a small change to just one source file here's what you do.
You select the desired source file so it is the active file in the IDE.
From the Build menu select the Compile option
If the source file is compiled without error then
Select Relink All from the Build Menu
If it is successful then the program can be run.
If the globals file is being changed then the entire program has to be recompiled.
In the latest version of the IDE there is a new option under Build - Compile/Relink All/Run

I said this is designed to address Andy's problem --- but in his case it doesn't work.

I ran into this once before.  For some reason if follow the above procedure with Andy's program it appears to link ok and you get an exe file that runs.  Problem is that instead of the exe being 9meg+ it is 4meg.

I'm going to use Andy's program to see if I can figure out what is happening since it gives me such a clear indication of when it is wrong.

What is still puzzling me Andy is that you say 3-4 minutes to compile and I'm rock solid at 43-45 seconds.

Sorry I wasn't more help
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

Larry was a big help on this.

yes, just compiling the one .iwb file, re-linking and executing has saved me a lot of time - thanks.

Just a note - my pc although getting on in years is still fast enough (in most cases for me) it's a
Intel® Pentium(R) D CPU 2.66GHz × 2  with 2Gb of Ram.

Still wonder why the entire project takes so long..... anyway it does compile, that's the main thing.

Andy
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.