|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
Zach
Joined: 13 Mar 2023 Posts: 85 Location: Groningen, Netherlands
|
Posted: Mon Apr 03, 2023 10:18 pm Post subject: |
|
|
In an effort to code ad analogiam Kenneth's code
program main
use clrwin
implicit none
integer :: iw
integer :: x = 10
integer :: y = 5
iw = winio@('%nl%gr[white]&',500,500)
call draw_filled_rectangle@(0,0,500,500,rgb@(255,255,255))
call draw_characters@('Hello World',x,y,rgb@(1,1,1))
end program main
What is wrong? / How to get it to work? Apologies if this is very stupid. |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1226 Location: Morrison, CO, USA
|
Posted: Tue Apr 04, 2023 1:23 am Post subject: |
|
|
Your program has a couple of faults. No matter, we've all done this at one time or another (for me about a week ago).
Your code should read:
Code: | WINAPP
program main
use clrwin
implicit none
integer :: iw,control=0
integer :: x = 10
integer :: y = 5
iw = winio@('%nl%gr[white]&',500,500)
iw = winio@('%lw',control)
call draw_filled_rectangle@(0,0,500,500,rgb@(255,255,255))
call draw_characters@('Hello World',x,y,rgb@(1,1,1))
end program main
|
Note that I declared an integer "control" that is required for a %lw.
The %lw is required so the window can be "created" and the program continues to the next lines afterward. Yet, the window remains!!
It is on those remaining lines that you can do what you wish. You cannot draw on a surface until it is created. It is not created until the window is actually built (hence the %lw).
Suggestion: Instead of "use clrwin", you can "use mswin". That will get you additional capabilities later on.
Also WINAPP is a good thing to use at the top of your main program to insure all the appropriate windows setup routines are called. |
|
Back to top |
|
|
Zach
Joined: 13 Mar 2023 Posts: 85 Location: Groningen, Netherlands
|
Posted: Tue Apr 04, 2023 5:43 pm Post subject: |
|
|
Hi, your corrected code works nicely. Thank you. How do I get rid of the black ugly compiler output frame behind the new white frame? Calling clear_screen@ doesn't do the job. And how do I make the font bigger in the new white frame? |
|
Back to top |
|
|
Zach
Joined: 13 Mar 2023 Posts: 85 Location: Groningen, Netherlands
|
Posted: Tue Apr 04, 2023 7:22 pm Post subject: |
|
|
program main
use clrwin
implicit none
integer :: iw,control=0
integer, dimension(2)::loc = (/20,50/)
iw = winio@('%nl%gr[white]&',500,500)
iw = winio@('%lw',control)
call draw_filled_rectangle@(100,100,500,500,rgb@(255,255,255))
!here
call locate(loc)
end program main
subroutine locate(loc)
use clrwin
integer,intent(in)::loc(2)
!there
call draw_characters@('Hello World',loc(1),loc(2),rgb@(1,1,1))
end subroutine
Hello World is being printed, But how do I pass "Hi there" form !here to !there and cause the called statement to print "Hi There"
Q: How do i make the font bigger?
Q: How could I get rid of the big black compiler output frame, behind the newly created white frame? |
|
Back to top |
|
|
Kenneth_Smith
Joined: 18 May 2012 Posts: 711 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Tue Apr 04, 2023 8:52 pm Post subject: |
|
|
One of a few possibilities:
Code: | winapp
program main
use clrwin
implicit none
integer :: iw,control=0
integer, dimension(1:2)::loc = (/20,50/)
iw = winio@('%nl%gr[red]&',500,500)
iw = winio@('%lw',control)
call draw_filled_rectangle@(100,100,500,500,rgb@(255,255,255))
call SCALE_FONT@(2.d0)
call locate(loc,'Hello World')
end program main
subroutine locate(loc,text)
use clrwin
integer,intent(in)::loc(2)
character(len=*) text
call draw_characters@(text,loc(1),loc(2),rgb@(1,1,1))
end subroutine |
|
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1226 Location: Morrison, CO, USA
|
Posted: Tue Apr 04, 2023 11:57 pm Post subject: |
|
|
Just FYI: your variable LOC is also an intrinsic integer(7) function. It returns the address of the argument.
FTN95 is really good about divining intent of reserved function names usage. Still, best to avoid using function names as variables with dimensions.
In the example:
Code: | integer(7):: i,a
i = loc(a)
print *,i
|
you will get the decimal address of the variable "a" printed.
LOC() has lots of great uses! |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1226 Location: Morrison, CO, USA
|
Posted: Wed Apr 05, 2023 12:02 am Post subject: |
|
|
Use WINAPP and the black DOS command box will not be displayed.
If you do console output in a WINAPP application, an output window will be created automatically. All I/O from to/from the console are carried out in this window.
Please note: When you close you main window and there is a console window displayed, you'll need to also close this window in order re-compile and run. |
|
Back to top |
|
|
Zach
Joined: 13 Mar 2023 Posts: 85 Location: Groningen, Netherlands
|
Posted: Wed Apr 05, 2023 7:57 am Post subject: |
|
|
Removed
Last edited by Zach on Wed Apr 05, 2023 12:21 pm; edited 1 time in total |
|
Back to top |
|
|
Kenneth_Smith
Joined: 18 May 2012 Posts: 711 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Wed Apr 05, 2023 9:02 am Post subject: |
|
|
Look up the help file for IMPORT_IMAGE@
Clearwin+ is extremely powerful and you should persevere with it.
Given the complexity of some of the user interfaces I have developed over the last 10 years using Clearwin+, I cannot fault the library, everything needed is there. |
|
Back to top |
|
|
Zach
Joined: 13 Mar 2023 Posts: 85 Location: Groningen, Netherlands
|
Posted: Wed Apr 05, 2023 1:15 pm Post subject: |
|
|
Is there a way to change the as is big cross-cursor into something more modest? And can the font be changed to Consolas, because the output as is, is very feeble. And can the size of big the black compiler output frame be reduced in size, and also to say: "One moment please."? Thank you very much in advance.
Last edited by Zach on Wed Apr 05, 2023 3:16 pm; edited 2 times in total |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1226 Location: Morrison, CO, USA
|
Posted: Wed Apr 05, 2023 1:26 pm Post subject: |
|
|
I suggest you look at the help available on cursors found in the FTN95 and Clearwin HELP file available through Plato. Search for cursor and gets lots of references. Read up on them. I use it constantly, even after a decade of using this product!
Specifically, winio@() format code%cu. I think you'll find good stuff there.
The help is available there, to start. |
|
Back to top |
|
|
Zach
Joined: 13 Mar 2023 Posts: 85 Location: Groningen, Netherlands
|
Posted: Wed Apr 05, 2023 1:40 pm Post subject: |
|
|
I did not expect to find (a reference to) the language manual under the help button of the ide. Sorry.
Last edited by Zach on Wed Apr 05, 2023 2:26 pm; edited 1 time in total |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1226 Location: Morrison, CO, USA
|
Posted: Wed Apr 05, 2023 1:52 pm Post subject: |
|
|
From PLATO. find "Help" on the menu bar and click it. |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1226 Location: Morrison, CO, USA
|
Posted: Wed Apr 05, 2023 3:05 pm Post subject: |
|
|
There is also an FTN95 link on this HELP menu, as well as for ClearWin, etc. Just pull it up, and search. It's a single HELP file (generally) that has links in Plato to the appropriate starting sections for the HELP you're looking for. |
|
Back to top |
|
|
Zach
Joined: 13 Mar 2023 Posts: 85 Location: Groningen, Netherlands
|
Posted: Wed Apr 05, 2023 5:03 pm Post subject: |
|
|
I am taking a break from this discussion. Thank you for having shown so much patience with me.
Last edited by Zach on Wed Apr 05, 2023 8:02 pm; edited 3 times in total |
|
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
|