Hello, First, thanks to Silverfrost for making a free version of their software available. I had Fortran77 in college last century and I’ve enjoyed refreshing my (limited) skills. I especially like Clearwin+ and the ability to make GUI’s fairly easily. Speaking of which, I’m having a problem with code I’ve written. It calculates various quantities relevant to stocks. Very simple math but when I enter a number in the second field of any of the 5 options, I get a “floating point stack fault”. I take that to mean that the number created is beyond the allocated memory. But the numbers are no larger than 105 or no smaller than 10-3 and I'm using Real8 values. And the error occurs before I even compute the value. Twice I got the “Blue Screen of Death” because of this. I upgraded from version 4.9 to 5.01 but it didn't help as well as trying to debug. The worst part is that it’s an intermittent problem. Sometimes it works fine. It may be a computer problem but I’ve written numerous programs including some with thousands of iterations with few problems. The only thing different is with this program I’m using the paneled radio button format within a parent window. I’ve searched the forum and haven’t found a similar problem. I keep thinking I may be overlooking something simple but I just don't know. Partial Code below. The module is a separate file. I use XP and Pentium chip. Thanks for any help. Tom !***************************************
Module Stocks_Mod
Implicit None
Character TenPercentStr*10,TenPercentPhrase*35,FivePercentStr*10,
Character FivePercentPhrase*35,PercentChangePhrase*35
Character PercentPhrase*30, PercentChangeStr*7
Character TotalSharePhrase*45,PercentStr*8
Character SharePhrase*35, TotalSharesStr*15, PricePhrase*26, TotalPriceStr*15, TotalPricePhrase*45
Real*8 TenPercent,FivePercent
Real*8 PercentChange,TotalShares, TotalPrice, Price_p_Share
Real*8 Price_p_Share_Final, Price_p_Share_Int
Integer*4 i, winio@, lwo, r(10)
End Module Stocks_Mod
!*****************************************
WINAPP
Use MSWIN
Use Stocks_Mod
External Shares, Price, PercentChange_Func, Five_Per, Ten_Per
r(1)=0
r(2)=0
r(3)=0
r(4)=0
r(5)=0
i=winio@('%ca[Stocks]%lw&',lwo)
i=winio@('%pv%fr',425,450)
i=winio@('%ww[no_frame,no_caption,no_border]&')
i=winio@('%5ga&',r(1),r(2),r(3),r(4),r(5))
i=winio@('%3.2ob[panelled]%^rb[Number of Shares]%cb&',r(1),Shares)
i=winio@('%^rb[Total Price]%cb&',r(2),Price)
i=winio@('%^rb[Percent Change]%cb&',r(3),PercentChange_Func)
i=winio@('%^rb[5%]%cb&',r(4),Five_Per)
i=winio@('%^rb[10%]%cb&',r(5),Ten_Per)
i=winio@('%aw%cb',lwo)
End
!************************************
Real*8 Function Price()
Use Stocks_Mod
External CalculatePrice, Z
TotalShares=0
Price_p_Share=0.01d0
TotalPricePhrase=' '
i=winio@('%ca[Price Calculator]&')
i=winio@('%cnEnter the share price: %nl%cn%rf&',Price_p_Share)
i=winio@('%2nl%cnEnter the number of shares: %2nl%cn%rf&', TotalShares)
i=winio@('%nl%cn%`^bt[Compute]%ta%^bt[Clear]&',CalculatePrice,Z)
i=winio@('%5nl%cn%ob%45st%cb&', TotalPricePhrase)
i=winio@('%aw',lwo)
Call window_update@(lwo)
Price=1
End Price
!***************
Real*8 Function CalculatePrice()
Use Stocks_Mod
PricePhrase='The total stock value is $'
TotalPrice=TotalShares*Price_p_Share
Write(TotalPriceStr,'(f10.2)')TotalPrice
Call trim@(TotalPriceStr)
TotalPricePhrase=PricePhrase//TotalPriceStr
Call window_update@(TotalPricePhrase)
CalculatePrice=1
End CalculatePrice