 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
stfark1
Joined: 02 Sep 2008 Posts: 255
|
Posted: Sun Sep 28, 2025 12:34 pm Post subject: winio@ |
|
|
Supposedly, in the winio@ language, one is supposed to be able to output a floating point number in a window as follows:
i=winio@('%14.4wf VARIABLE &'), where:
14.4 outputs the floating point number
VARIABLE is the variable name
& leaves the window open for future activity
I have this sequence in my subroutine, after I have specified the window, size, etc.
However, even though I set the Variable to a value, it always comes out zero in the window??? Totally perplexed why, any advise? Sid kraft |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8277 Location: Salford, UK
|
Posted: Sun Sep 28, 2025 3:48 pm Post subject: |
|
|
double precision var
var = 1.2345d0
i=winio@('%14.4wf',var)
end |
|
Back to top |
|
 |
stfark1
Joined: 02 Sep 2008 Posts: 255
|
Posted: Mon Sep 29, 2025 2:58 am Post subject: winio@ |
|
|
Paul: I changed the variables as you had requested, made them all DOUBLE PRECISION. Ran the example, they were output to the window and all values were 0.0000. I tried to find an example in the winio@ pictorial that was put together by the Salford people and could not find an actual program segment sample that showed the "i=winio@('%wf14.4, Var &')" use. I believe that there is a very simple problem in using this winio@ feature that I am overlooking, should not be that hard. Is it possible to find an actual example of this structure being used in a Fortran program? Let me know, Sid Kraft |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8277 Location: Salford, UK
|
Posted: Mon Sep 29, 2025 6:47 am Post subject: |
|
|
Sid
If you can post some sample code to show what you are doing then someone will probably be able to help you.. |
|
Back to top |
|
 |
stfark1
Joined: 02 Sep 2008 Posts: 255
|
Posted: Mon Sep 29, 2025 12:10 pm Post subject: winio@ |
|
|
Here it is:
SUBROUTINE OPENGL(ROT,XX,YY,ZZ)
IMPLICIT REAL*8 (A-H,O-Z)
COMMON PLTX(110), PLTY(110), PLTZ(110), ICIRCL, SGSIZE, INOW
C COMMON ROT,XX,YY,ZZ
INCLUDE <clearwin.ins>,nolist
INCLUDE <opengl.ins>,nolist
INTEGER*4 ctrl, INDX, INDXSV, IPLCDE, IPEN(110),IPENI,ISTRSG, II
CHARACTER ABUFF(80)
CHARACTER*1 A49(49)
DIMENSION X(110), Y(110), Z(110), II(110),JJ(110),KK(110)
C SET THE WINDOW HEADER
i=winio@('%es%ca[Simple OpenGL Example]&')
C SET THE WINDOW SIZE
i=winio@('%sp%ww[no_border]%og[static]%lw',0,0,1500,1500,ctrl)
C OUTPUT THE VARIABLES ROT, XX, YY, ZZ
i=winio@('%14.4wf ROT &')
i=winio@('%14.4wf XX &')
i=winio@('%14.4wf yy &')
i=winio@('%14.4wf ZZ &')
In the above example, when I output the variables ROT, XX, YY, ZZ as shown
from winio@, they all are displayed as 0.0000?? Even though I declared the output to be equivalent to the Fortran directed output to be f14.4, i.e. theoretically as 14 characters long with 4 characters after the decimal point, totally confused why the variables are 0.0000. The variables are utilized in the OpenGL software to rotate 20 degrees around the ZZ axis, i.e. again, ROT=20., XX=0., YY=0., ZZ=1. Any ideas will be appreciated, Sid Kraft |
|
Back to top |
|
 |
stfark1
Joined: 02 Sep 2008 Posts: 255
|
Posted: Mon Sep 29, 2025 12:22 pm Post subject: winio@ |
|
|
Answer from winio@ 0.0000ROT, 0.0000XX, 0.0000YY, 0.0000ZZ when the variables are output to the window in the previous example, Sid Kraft |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8277 Location: Salford, UK
|
Posted: Mon Sep 29, 2025 3:26 pm Post subject: |
|
|
Sid
It looks like you have displayed the initial values of these variables before the process to change them has been applied.
You might find it helpful to use the debugger and to step through the process that is generating the output.
%lw means "leave window open" so what follows it happens immediately. |
|
Back to top |
|
 |
stfark1
Joined: 02 Sep 2008 Posts: 255
|
Posted: Tue Sep 30, 2025 3:27 pm Post subject: winio@ |
|
|
Paul: I did process using the debugger, the variables were set from a calling machine and passed to the shown routine as arguments. Thus, should have been initialized before being sent. In actuality, when using the debugger, I displayed the variables just before the winio@ output and they were set to the values that I want. I still think that it is the way that I am calling for the variables to be output from winio, that is why an example of the application would be so helpful, Sid Kraft |
|
Back to top |
|
 |
Kenneth_Smith
Joined: 18 May 2012 Posts: 853 Location: Lanarkshire, Scotland.
|
Posted: Tue Sep 30, 2025 7:11 pm Post subject: |
|
|
i=winio@('%14.4wf ROT')
should be:
i=winio@('%14.4wf', ROT)
etc. |
|
Back to top |
|
 |
stfark1
Joined: 02 Sep 2008 Posts: 255
|
Posted: Tue Sep 30, 2025 8:28 pm Post subject: winio@ |
|
|
Thanks, that worked, Sid Kraft |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8277 Location: Salford, UK
|
Posted: Wed Oct 01, 2025 6:50 am Post subject: |
|
|
In general %wf is only used to display values that are known when the window is created. It creates a Microsoft Windows "Static" control.
It is usually more appropriate to use %rf to output results generated at runtime. This creates a Microsoft Windows "Edit" control.
The display for %rf can be made to look like that for %wf by using a grave accent %`rf, whilst formatting can be applied via the %rf[fmt=...] option.
Also it is usually necessary to synconise the display to match the result variable by, for example, calling window_update@(xx). |
|
Back to top |
|
 |
stfark1
Joined: 02 Sep 2008 Posts: 255
|
Posted: Fri Oct 03, 2025 5:36 pm Post subject: winio@ |
|
|
Another issue, when I call the GL command in SilverFrost Fortran and have the rotate transformation command CALL glRotatef(ROT,XX,YY,ZZ) from the above program segment with ROT=60., XX=0., YY=0., ZZ=1. the GL command is supposed to rotate the geometrical elements by 60 degrees about the ZZ axis. It does not, leaves the substituted parameters at 0., 0., 0., 0. I would think that the programing would allow the substituting of the values in the parameters into the command but does not seem to work. Any suggestions? Sid kraft |
|
Back to top |
|
 |
stfark1
Joined: 02 Sep 2008 Posts: 255
|
Posted: Mon Oct 06, 2025 2:02 pm Post subject: winio@ |
|
|
Per the above samples and statements, being that the OpenGL system and the
requirement in the command glRotatef(ROT,XX,YY,ZZ) that the parameters be of the highest significance, what is the difference in the declarations IMPLICITE REAL*8 (A-H,O-Z) and DOUBLE PRECISION ROT, XX, YY, ZZ. This may be why the parameters submitted have actual values but when the command is executed, the variables turn out to be zero, Sid Kraft |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8277 Location: Salford, UK
|
Posted: Mon Oct 06, 2025 3:25 pm Post subject: |
|
|
Both forms declare ROT, XX, YY and ZZ as double precision. |
|
Back to top |
|
 |
|
|
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
|