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 

Crash:This routine has been entered recursively (-ANSI mode)

 
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: 1921
Location: South Pole, Antarctica

PostPosted: Thu May 02, 2019 6:03 am    Post subject: Crash:This routine has been entered recursively (-ANSI mode) Reply with quote

I got this message when implemented slider %sl which calls function SliderFunction. The demo is here, but this demo works fine, itis the main code which crashes
Code:
module mod111
integer kBusySliding
real*8 SliderVariable
CONTAINS
Integer function SliderFunction ()
  if(kBusySliding.eq.1) goto 10000
  kBusySliding = 1
  a=2.3
  Do i=1,5000000
  a=log(exp(a))
  enddo
  print*, a
kBusySliding = 0
10000 continue
SliderFunction=2
end function
end module mod111
!=============================
PROGRAM aaa
use mod111
  kBusySliding = 0
  i=winio@('%60^sl', SliderVariable, 0d0, 1d0, SliderFunction)
end program

Inside this function goes some calculation but seems during mouse movement the slider calls this function hundreds times and way before the calculation inside the function SliderFunction ends. Despite that i implemented for such exact cases the measure (see the trick introducing variable kBusySliding) to prevent any new computations before previous ones complete (and may cause problems due to that), this time the crash happens exactly on the first line of function SliderFunction before doing anything

Questions:
1) How to get rid of this crash? Though i admit that though the compiler is strict and absolutely right, but in this specific case i do not care about possible problems with the recursion, i just do not want it to crash. I will prevent potential collisions myself with kBusySliding trickery which worked perfectly for decades
2) What means -ANSI mode warning in this case ? Good that such warning exists though i do not find it enough verbose to tell me more hints. With -ANSI this program even does not compile, so what for this -ANSI warning was made?

This demo example above works OK both with 64 and 32bits.


Last edited by DanRRight on Thu May 02, 2019 11:02 pm; edited 1 time in total
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu May 02, 2019 8:36 am    Post subject: Reply with quote

Dan

You may need to use a recent version of the ClearWin+ library in order to avoid the recursive element.
Back to top
View user's profile Send private message
DanRRight



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

PostPosted: Thu May 02, 2019 11:01 pm    Post subject: Reply with quote

OOps, i missed your PM. Will try new library, thanks
Back to top
View user's profile Send private message
DanRRight



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

PostPosted: Fri May 03, 2019 12:54 pm    Post subject: Reply with quote

Still crashing. But sometimes not. Demo above also works fine. I do not know what's to do. Interesting is that using the wheel %dd with %^rd which calls the same function works no problem
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Fri May 03, 2019 1:26 pm    Post subject: Reply with quote

I would need a sample program that demonstrates the failure before I could comment.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
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