forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

25 years old Treeview crash
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
DanRRight



Joined: 10 Mar 2008
Posts: 2479
Location: South Pole, Antarctica

PostPosted: Sat Oct 09, 2021 7:16 pm    Post subject: 25 years old Treeview crash Reply with quote

When Clearwin+ appeared ~25 years ago i tried its nice feature called treeview which i thought would simplify and catalog different applications of my code making finding anything in just few clicks. Making tree structure larger and more complex i got an error and despite the efforts it did not go away. At that time communication like today on such forums was not that transparent and when you get some error or bug you might be forced to stop or postpone the idea. Now you can ask users or developers and this helps very much.
Here is my question: i completely forgot but recently found 25 years old code which i abandoned due to bug or error. I may extract smaller code to demonstrate the bug but may be someone already had such error and this may save me time ? For those who are not familiar with Clearwin this all you see (and much more you don't) was done yet in Fortran77
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7160
Location: Salford, UK

PostPosted: Sat Oct 09, 2021 9:10 pm    Post subject: Reply with quote

Dan

It looks like your program is exiting before you want it to. Maybe a %lw that is not working as planned. Prehaps then ClearWin+ is still trying to run and some variable (accessed by ClearWin+) is no longer live (in scope).

Look at the exit point. Add some print statements to act as a trace. Maybe avoid the %lw.

The original %tv was improved in %bv which may be more robust.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2479
Location: South Pole, Antarctica

PostPosted: Sun Oct 10, 2021 8:40 am    Post subject: Reply with quote

Thanks Paul for suggestions.
Tried some of them. This bug is definitely some devilry work Smile Afraid i will not have enough free time to resolve it as ones i spent a month for that. Will look at %bv if switching from %tv is easy

The error message above suggests that something is wrong with the tree branches definitions which start with letters ABCDE etc depending on the level in the tree. I tried simples trees but things do not change which again suggests that the bug is not easy one.

But for future could be beneficial for bug hunting to make the error message like above more verbose to tell exactly which record is wrong.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7160
Location: Salford, UK

PostPosted: Sun Oct 10, 2021 1:50 pm    Post subject: Reply with quote

Dan

If you can't trim the program down then you can send it to me as it is. But I won't be able to look at it for a few weeks as there is a backlog of issues to resolve.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2280
Location: Yateley, Hants, UK

PostPosted: Mon Oct 11, 2021 5:36 pm    Post subject: Reply with quote

Dan,

Isn't the error message explicit? Or is it something else?

Eddie
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2479
Location: South Pole, Antarctica

PostPosted: Mon Oct 11, 2021 10:24 pm    Post subject: Reply with quote

Eddie, Most probably it's something else. I have working demo code which creates file with tree view. This file this demo code can load again with no complaints. When i use this file with real code it crashes.

Anyway, i will probably give up and postpone with tree view for the next 25 years. It is cool and useful feature but i do not have time to further develop it even if this bug will be fixed. The initial idea was to keep the most important basic things there like code self-testing or minimal settings for most used variants. But most probably what would happen if i succeeded 25 years ago is that this tree would be today so large that it again could be unusable and require further tricks to sort the bookmarks. I currently use 7 Total Commanders open at the same time of different color to distinguish them better, each has around 100 of bookmarks (Ctrl+D) and despite additional notes and comments i'm still totally lost in all that.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7160
Location: Salford, UK

PostPosted: Tue Oct 12, 2021 6:48 am    Post subject: Reply with quote

Dan

You seem to imply that this particular failure is due to a bug in ClearWin+. From the traceback this seems to me to be very unlikely but my offer to investigate it stands. All you need to do is zip up the whole project and send it to me.
Back to top
View user's profile Send private message AIM Address
JohnCampbell



Joined: 16 Feb 2006
Posts: 2357
Location: Sydney

PostPosted: Tue Oct 12, 2021 7:47 am    Post subject: Re: Reply with quote

DanRRight wrote:
I currently use 7 Total Commanders

Dan, do you use the "Total Commander" application, which I thought was derived from XTree ? Is it still available for Win7/10/11 ?
I use FTN95's "files8@" all the time to search for files, especially recent files or files related to a project.
I have considered combining files@ with tree view to get a viewer that does what I want. I am wondering how useful you are finding the Tree View approach ?
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2479
Location: South Pole, Antarctica

PostPosted: Tue Oct 12, 2021 9:47 pm    Post subject: Reply with quote

John,
I do not know how useful TreeView is as i had no chance to use it for longer period of time than just while playing with it. I feel it is very useful for few things but will it substitute mighty Total Commander with its 30 years and 83 million visits ( link to it is www.ghisler.com )?

I was trying with TreeView to mimic Total Commander directly gluing it into the code but not sure i would succeed. It is like preset Files@ for specific task, where you just click on name "Code Self Test" or "Classic Case1 for Laser Plasma" or "Laboratory Report 2012" or "Canadian project 2021" and you already there, all present, you see all files, all results and if you need to run you do not need to search anything on your computer you just click "Start Run" and if you need to view or edit you also just click on file. For even better convenience i glued TreeView with ListView as you can see on my picture above

Paul,
I think i reproduced the crash in small code but after removing it there still exist other problem, causing different crash which i'm looking at now. Crash with these mentioned missing C and E is also reproduceable with TREEVIEW code in Clearwin Salford Examples if number of entries is lower than dimension. Now will try to use %bv
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2479
Location: South Pole, Antarctica

PostPosted: Wed Oct 13, 2021 9:29 pm    Post subject: Reply with quote

Paul,
I found this program for %bv called dialog.f90 which was made with MS Dev.Studio with its resource file which immediately makes simple things, like FTN95 usually has, unnecessary messy. Besides without icons it looks ugly. Do you have an example without MS like the one in FTN95 examples\clearwin\TREVIEW.F90?
Code:
WINAPP 'resource.rc'
PROGRAM dialog
IMPLICIT NONE
INCLUDE <windows.ins>
INCLUDE 'resource.inc'
 INTEGER,PARAMETER::N=4,M=4
 INTEGER  wr,s1(N-1),s2,start_cb,save_cb
 EXTERNAL start_cb,save_cb
 CHARACTER*16 items1(N),items2(M)
 s1=0
 wr=winio@('%di&',IDD_DIALOG1)
 wr=winio@('%?ib[flat][Toolbar item]&',IDC_STATIC1,'explore',4,save_cb)
 wr=winio@('%?lv[][List view]&',IDC_LIST1,items1,N,s1,1)
 wr=winio@('%?bv[][Tree view]&',IDC_TREE1,items2,M,s2)
 wr=winio@('%?gr[green,rgb_colours][Graphics region]&',IDC_STATIC2)
 wr=winio@('%?bt[OK button]&',IDOK)
 wr=winio@('%sc',start_cb)
END

INTEGER FUNCTION start_cb()
INCLUDE <windows.ins>
INTEGER w,h
 w=clearwin_info@('GRAPHICS_WIDTH')
 h=clearwin_info@('GRAPHICS_DEPTH')
 CALL draw_filled_ellipse@(w/2,h/2,w/3,h/4,255)
 start_cb=1
END

INTEGER FUNCTION save_cb()
INTEGER wr,winio@
 wr=winio@('%ca[Message]%bg[grey]Toolbar item.')
 save_cb=1
END


By the way here is how looked my TreeView before it was abandoned decades ago when i ran it today. On top is Settings dialog box allowing to assign icons, directories etc to the item in the TreeView list. Of course it was pity to get the bug i had no time to fix. ListView showing all TotalCommander-like (or XTree-like, or NortonCommander-like) file attributes like Eddie recently showed

Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7160
Location: Salford, UK

PostPosted: Thu Oct 14, 2021 9:46 am    Post subject: Reply with quote

Dan

Here is a program that I have extracted from a program called demo.f95 which can be downloaded from https://www.dropbox.com/s/hp27kjbq56g8anw/demo.zip?dl=0.

Code:
INTEGER FUNCTION exTr()
  INTEGER,PARAMETER::N_ITEMS=10
  CHARACTER(30) contents(N_ITEMS)
  INTEGER item,iw,winio@
  DATA contents /'AEBBook', &
       'BCAChapter 1', 'CCASection 1.1', 'CCASection 1.2', &
       'BCAChapter 2', 'CCASection 2.1', 'CCASection 2.2', &
       'BCAChapter 3', 'CCASection 3.1', 'CCASection 3.2'/
  item = 1
  iw = winio@("%ww%pv&")
  iw = winio@("%ca[ClearWin+]&")
  iw = winio@("%`bv[has_buttons,has_lines,lines_at_root,paired_bitmaps,24bits]", &
              200,160,contents,N_ITEMS,item,"closed,opened")
  exTr = 2
END FUNCTION exTr

WINAPP
PROGRAM main
INTEGER r
INTEGER,EXTERNAL::exTr
r = exTr()
END PROGRAM

RESOURCES
closed  BITMAP closeb.bmp
opened  BITMAP openb.bmp
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2479
Location: South Pole, Antarctica

PostPosted: Fri Oct 15, 2021 11:03 pm    Post subject: Reply with quote

Many thanks, Paul. Indeed looks incredibly simple (compared to %tv). Will see if it is more feature rich and is stable to users' torture Smile
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2479
Location: South Pole, Antarctica

PostPosted: Sat Oct 16, 2021 5:10 am    Post subject: Reply with quote

Paul,
Here is first problem with %bv. If you do small change in the demo code above by placing CONTENTS variable out of DATA it works as it should be. But if you remove couple entries like shown below, the EXE does not even start, including in debugger. Even worse, after this program will fail, when you return to first working program and compile it - it also fails to run (!!!). You will need to move sources to different folder and recompile

The treeview %tv in such situation being compiled with /undef gives the error ( with C and E mentioned above in first post ) and crash.

Formally what i have done is creating an error but this is what for sure will happen with CONTENTS files during program use due to million reasons. I'd still allow it to run giving user some warning, or he will not find the bug for 25 years ;(

Code:
INTEGER FUNCTION exTr()
  INTEGER,PARAMETER::N_ITEMS=10
  CHARACTER(30) contents(N_ITEMS)
  INTEGER item,iw,winio@
!  DATA contents /'AEBBook', &
!       'BCAChapter 1', 'CCASection 1.1', 'CCASection 1.2', &
!       'BCAChapter 2', 'CCASection 2.1', 'CCASection 2.2', &
!       'BCAChapter 3', 'CCASection 3.1', 'CCASection 3.2'/

contents(1) = 'AEBBook'
contents(2) = 'BCAChapter 1'
contents(3) = 'CCASection 1.1'
contents(4) = 'CCASection 1.2'
contents(5) = 'BCAChapter 2'
contents(6) = 'CCASection 2.1'
contents(7) = 'CCASection 2.2'
contents(8) = 'BCAChapter 3'
!contents(9) = 'CCASection 3.1'
!contents(10) = 'CCASection 3.2'

  item = 1
  iw = winio@("%ww%pv&")
  iw = winio@("%ca[ClearWin+]&")
  iw = winio@("%`bv[has_buttons,has_lines,lines_at_root,paired_bitmaps,24bits]", &
              200,160,contents,N_ITEMS,item,"closed,opened")
  exTr = 2
END FUNCTION exTr

WINAPP
PROGRAM main
INTEGER r
INTEGER,EXTERNAL::exTr
r = exTr()
END PROGRAM

RESOURCES
closed  BITMAP closeb.bmp
opened  BITMAP openb.bmp


For all - if you want to run this code make two bmp icons 16x16 pixels shown in RESOURCES file

The %bv is more stable than %tv at least with respect to mentioned C and E because if you initialize variable

contents(Smile=' '

the %bv does not complain about missing entries
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7160
Location: Salford, UK

PostPosted: Sat Oct 16, 2021 7:47 am    Post subject: Reply with quote

Dan

I have made a note of your request.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7160
Location: Salford, UK

PostPosted: Mon Oct 18, 2021 11:26 am    Post subject: Reply with quote

%bv has now been improved for the next release of ClearWin+.

Additional checks have been added.

Also users will be able to make a call to clearwin_option@("undef") combined with /CHECKMATE on the FTN95 command line. This will generate a runtime error when the data strings are not defined.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group