Page 8 of 11

Re: CodeCaddy v1.80x build 792 12.03.10 save 8

Posted: Sun Mar 14, 2010 9:19 am
by KJ67
Hi blueznl!


I've enjoyed your nice CodeCaddy for some time and I'm well due to say a big Thank You!
Image

But when I try to download 1.80 (12-03-10), I get 1.74 (2010-03-06).
Is it just me who has some old stuff in my cache or?

Re: CodeCaddy v1.80x build 792 12.03.10 save 8

Posted: Sun Mar 14, 2010 9:47 am
by blueznl
The file quickhelp.txt may be older than the executable. Try Help / About. What version does it report?

Re: CodeCaddy v1.80x build 792 12.03.10 save 8

Posted: Sun Mar 14, 2010 9:52 am
by KJ67
Re-downloaded, removed all old files and installed the fresh packet.
In your 'About' I read, (build 771 06.03.01 save 7956)... :?:

Re: CodeCaddy v1.80x build 792 12.03.10 save 8

Posted: Sun Mar 14, 2010 10:36 am
by blueznl
Sounds like I forgot to include the latest executable. The source is probably ok. I will check and upload the right version in a few minutes if that is the case.

Re: CodeCaddy v1.80x build 792 12.03.10 save 8

Posted: Sun Mar 14, 2010 11:30 am
by blueznl
Okay, upped it again. As I expected the executable was the wrong one. I've written a few batch files / ftp scripts to upload code and webpages. One of the few things I lost due to my recent HDD crash was the folder with the latest batch files. With the new harddrives I've put purebasic on a different drive yet did not remove the old folder yet. Nett result: the batch file was copying an older version of the wrong executable.

Things should be fixed now :-)

So, one more time...

Update v1.80x.

- new feature: thinner

Simply put, the new thinner tool allows stripping out all unused code / procedures / macros, either by hand by calling the 'thinner' function from the CodeCaddy menu, or as part of the build process (optionally, of course). Though thus far I could compile all my own code with this option enabled, that does not mean it's entirely bug free. (Hey, I wrote it, so you have reason to worry.) The good part: you can disable it.

As usual, the file is here.

If you have no clue what CodeCaddy is all about go here.

Re: CodeCaddy v1.80x build 792 12.03.10 save 8350

Posted: Tue Mar 16, 2010 4:14 am
by yrreti
Hi blueznl!
Something went wrong with this last change.
I could compile and run my program with in the IDE, but could not compile it to an exe.
I kept getting 'procedure declared but not defined' errors with the codecaddy-build(auto) function
that never happened before with the previous version. I had to uncheck that box in the Configure Tools
list in order for me to compile to exe the program that I have been working on with out giving me that error.
I attached a short code section that will give the error with that function checked, but compiles to exe fine with
it unchecked. You will need to enter a file name existing on your hard drive for Filename$= for it to
run properly.

Code: Select all

Structure CreationTime
  dwLowDateTime.w
  dwHighDateTime.w
EndStructure

Structure LastAccessedTime
  dwLowDateTime.w
  dwHighDateTime.w
EndStructure

Structure LastWriteTime
  dwLowDateTime.w
  dwHighDateTime.w
EndStructure

Structure FileTimeToSystemTime
  wYear.w;
  wMonth.w;
  wDayOfWeek.w;
  wDay.w;
  wHour.w;
  wMinute.w;
  wSecond.w;
  wMilliseconds.w;
EndStructure

Declare.s FileTime(fspec$)  

Procedure.s FileTime(fspec$)
  ;Protected fspec$
  Protected CT.CreationTime
  Protected LA.LastAccessedTime
  Protected LW.LastWriteTime
  Protected st.FileTimeToSystemTime
  Protected LocalTime.FileTimeToSystemTime  ;added to use Local System Time
  
  hwnd=CreateFile_(fspec$,#GENERIC_READ,#FILE_SHARE_READ,null,#OPEN_EXISTING,#FILE_ATTRIBUTE_NORMAL,null )
  If hwnd > 0  ; Only test files ( return = null string if directory )
    void = GetFileTime_(hwnd,CT,LA,LW);CreateTime, LastAccessed, LastWrite times
    ;FileTimeToSystemTime_(LW,ST)   ;(System Time <> Local Time eg:Central Standard Time
    FileTimeToLocalFileTime_(LW,LocalTime);convert File Time To Local File Time
    FileTimeToSystemTime_(LocalTime,st)                                                                               ;   just leave Seconds out
    fspec$ = Str(st\wMonth) + "/" + Str(st\wDay) + "/" + Str(st\wYear) + "  " + Str(st\wHour) + ":" + Str(st\wMinute) ;  + ":" + Str(ST\wSecond)
    CloseHandle_(HWND)
    
    ;Time is in Military 2400 time.  Convert to AM PM time
    P = FindString(fspec$, ":", 1)
    th=Val(Mid(fspec$,P-2,2))
    ts$=Mid(fspec$+"00",P,3)
    fspec$=Trim(Left(fspec$,p-3))+" "
    If th < 13
      fspec$=fspec$+Str(th)+ts$+" AM"
    Else
      th=th-12
      fspec$=fspec$+Str(th)+ts$+" PM"
    EndIf
  Else
    fspec$=""
  EndIf
  ProcedureReturn fspec$
EndProcedure
Filename$="D:\DCAT\MAIN_D~1.BMP"  ;<=====<<<<  you need to put any valid file name found on your hard drive here.
fspec$=FileTime(Filename$)               ;   (won't hurt the file, just gets time and date info)
Debug fspec$

Re: CodeCaddy v1.80x build 792 12.03.10 save 8350

Posted: Tue Mar 16, 2010 8:15 am
by blueznl
Ah, do you declare it but not use it?

I think I did not strip out unused declares... Only the unused procedures.

I assume the option you had to turn off was 'strip unused during build', correct?

I'll have a look at it. Should be easy to fix.

Which version are you using?

Edit: note that the code you posted is not complete and isn't running, and I do not get that error even if I declare something I do not use later on, such as in this:

Code: Select all

Declare.s testb(b.l)

Procedure.l testa(a.l)
  Protected aa.s
  aa.s = testb(b.l)
EndProcedure

Procedure.s testb(b.l)
  ProcedureReturn Str(b.l)
EndProcedure

Debug "Duh"
I will probably need a bit of code that works when run and not when build, as I cannot reproduce the problem. Contact me per PM if you want, or change your sample a bit to make it work when run so I can test it...

Nevertheless, I've upped a new version that strips out unused Declare statements, just to be sure. It's CodeCaddy v1.84x, please test it.

Re: CodeCaddy v1.80x build 792 12.03.10 save 8350

Posted: Tue Mar 16, 2010 12:38 pm
by yrreti
Hi blueznl!

I first stress again and again. Thank you for providing your nice program!
Perhaps maybe a dumb question, but is there any place where you can view the version?
I always save the zip which I label, but that might not necessarily be the true version.
I am using what was in the codecaddy v1.80 build 792 12.03.10 save 8350.zip file.
Also using PB4.41.
I noticed that I added the Declare after I pasted the code above, and I forgot to add the '.s'.

Code: Select all

Declare FileTime(fspec$)
Declare.s FileTime(fspec$)
I just tried the corrected code above again.
But I didn't see this listing?
I assume the option you had to turn off was 'strip unused during build', correct?
What I saw was codecaddy-build(auto) under Tools - Configure Tools.
With the codecaddy-build(auto) function checked, I had to add the Declare, because when trying to create
executable, I would get the error: FileTime() is not a function, array, macro or linked list.
Then I would get the second error I described earlier: The following procedure has been Declared but not defined:FileTime. compile/run under the IDE works fine.

Unchecked, with or without the Declare.s FileTime(fspec$), the command 'create executable' works fine on my system.
It won't work though if the following isn't done though.

Code: Select all

Filename$="D:\DCAT\MAIN_D~1.BMP"  ;<=====<<<<  you need to put any valid file name found on your hard drive here.
fspec$=FileTime(Filename$)               ;   (it won't hurt the file, just gets time and date info)
I just noticed that you posted a new update.
Nevertheless, I've upped a new version that strips out unused Declare statements, just to be sure. It's CodeCaddy v1.84x, please test it.
I will try this and PM you back.
Thanks for your help.

Re: CodeCaddy v1.80x build 792 12.03.10 save 8350

Posted: Tue Mar 16, 2010 6:06 pm
by blueznl
yrreti wrote: Perhaps maybe a dumb question, but is there any place where you can view the version?
This surprises me a little. Just start CodeCaddy (or press [Ctrl]+[F1] on an empty line in the editor) and CodeCaddy pops up. You can always find the version number on the titlebar of the window, or you can check the Help / About menu where it will list some additional information.
I noticed that I added the Declare after I pasted the code above, and I forgot to add the '.s'.
I think there are some more declarations missing. For example...

Code: Select all

Protected CT.CreationTime
Protected LA.LastAccessedTime
Protected LW.LastWriteTime
I assume the option you had to turn off was 'strip unused during build', correct?
What I saw was codecaddy-build(auto) under Tools - Configure Tools.
I'm almost thinking you never started CodeCaddy itself. Did you ever doubleclick on codecaddy.exe? If so, check out the menu Options / Preferences and go to the tab Pre-Process. Here you will find the tick box 'remove unused procedures and macros from builds' and clear it. Here's an illustration:

Image

Ignore the rest, only 'remove unused procedures and macros from builds' is important, clear it and CodeCaddy will no longer 'thin' code before creating a build.

Just drop me a little snippet that works in compile / run but not in build. Your example above doesn't work on my machine, not even in compile / run.

Re: CodeCaddy v1.80x build 792 12.03.10 save 8350

Posted: Tue Mar 16, 2010 10:06 pm
by blueznl
Fixed.

(Ah, always wanted to say that :-))

Re: CodeCaddy v1.80x build 792 12.03.10 save 8350

Posted: Wed Mar 17, 2010 1:35 am
by yrreti
Thanks much blueznl
It works good now. :D

Re: CodeCaddy v1.80x build 792 12.03.10 save 8350

Posted: Wed Mar 17, 2010 2:40 am
by DoubleDutch
It would be good if the thinning dialog had some kind of progress bar.

Re: CodeCaddy v1.80x build 792 12.03.10 save 8350

Posted: Wed Mar 17, 2010 6:50 pm
by blueznl
DoubleDutch wrote: It would be good if the thinning dialog had some kind of progress bar.
Uh?!? It does! Well, except the earliest version, but since then it does. So now I'm at a loss again... What version are you running?

Re: CodeCaddy v1.85x build 816 16.03.10 save 8412

Posted: Wed Mar 17, 2010 7:33 pm
by blueznl
Update v1.85x build 816 16.03.10 save 8412.

(Actually, this version has been up for a while now, but hey, it's all about customer service :-) and perhaps one day I'll be able to call this CodeCaddy 7 ;-))

- thinning progress indicator (already in there since 1.81x I believe :-))
- fixed a thinning bug related to capitals in procedure names
- added a line counter to the progress window

If you see the line counter jump, that is correct. It actually lists the line currently being processed by CodeCaddy.

As usual, the file is here.

If you have no clue what CodeCaddy is all about go here.

Re: CodeCaddy v1.80x build 792 12.03.10 save 8350

Posted: Wed Mar 17, 2010 9:12 pm
by DoubleDutch
It didn't appear on 1.85x build 816 16.03.10 save 8412

Maybe there needs to be a forced redraw of the bar or a wait()?