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 

rf with help text and format

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
Eugippius



Joined: 11 Sep 2017
Posts: 2
Location: Bad Soden am Taunus, Germany

PostPosted: Fri Dec 10, 2021 7:54 pm    Post subject: rf with help text and format Reply with quote

This is my fist post to the forum, so I may introduce myself: I am a (almost) retired civil Engineer who has worked with Fortran on and off for about 50 years.
I am now working on a program that allows to view 80 columns input files (i.e. cards) together with the field names. the input requirements, and the allowable sequence of cards.
I have put together such a program once by using the Spindrift Library (now defunct), but the executable is only 16 bit. With this example and dozens of already existing input descriptions, I hope to manage to complete a similar program by using the facilities of ClearWin+.

As a first step, i have studied the sample programs and read many forum posts; now I started to build my first test (heavily drawing from examples, as you will see), experimenting with input fields for displaying integer, real and character data.
I want to use colour to indicate the input requirements: numeric, mandatory field, unchangeable, etc.

The success is mixed: While I can display and modify the data, I could not use the help and format options together in %rf (see lines 50 to 56 in the attached code.
Any advice is most welcome.

I just realize that my code listing has apparently lost all indentation. How to make it better?

Edit: Incomplete code fragment deleted.


Last edited by Eugippius on Sat Dec 11, 2021 12:34 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
LitusSaxonicum



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

PostPosted: Fri Dec 10, 2021 8:06 pm    Post subject: Reply with quote

Highlight the code, and click the Code button.

Also, there is a limit to the length of the post. Please check, and post the rest of the code in a second post.

You probably need a %th or %bh to enable the help system. You can also put a help string into a status bar - if you have one.

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



Joined: 11 Sep 2017
Posts: 2
Location: Bad Soden am Taunus, Germany

PostPosted: Fri Dec 10, 2021 8:45 pm    Post subject: Reply with quote

format and help options work individually for %rf, but not together.
Thanks for the advice
Josef
[code]
WINAPP
INCLUDE <windows.ins>
CHARACTER*129 file,new_file,help_file
CHARACTER*10 file_name
character*5 ss1
integer ii1,number
double precision rr1
INTEGER compile,link,run,i
EXTERNAL compile,link,run
file_name='KA_MASK'
number=5
ii1=876
rr1=123.45670d00
ss1='ABCDE'
C menu
help_file='myhelp.hlp'
i=winio@('%ca['//file_name//']&')
i=winio@('%mn[&File[&Open]]&','EDIT_FILE_OPEN','*.*',
+ file)
i=winio@('%mn[[&Save]]&','EDIT_FILE_SAVE','*.*',
+ new_file)
i=winio@('%mn[[Save &As]]&','EDIT_FILE_SAVE_AS','*.*',
+ new_file)
i=winio@('%mn[[E&xit]]&','EXIT')
i=winio@('%mn[&Edit[&Copy]]&','COPY')
i=winio@('%mn[[Cu&t]]&','CUT')
i=winio@('%mn[[&Paste]]&', 'PASTE')
i=winio@('%mn[&Help[&Contents]]&','HELP_CONTENTS',
+ help_file)
i=winio@('%mn[[&Help on help]]&','HELP_ON_HELP',
+ help_file)
C input fields
i=winio@('%fn[Courier New]&') !select a font for subsequent text
i=winio@('%ap&',1,1) !set absolute position for the next control
i=winio@('%ww[]&') !change style of the window
i=winio@('%co[check_on_focus_loss,right_justify]&')
i=winio@('%3`rd&',number) ! display an integer, read only

i=winio@('%ap&',1,3) !set absolute position for the next control
i=winio@('%ww[]&') !change style of the window
i=winio@('%co[check_on_focus_loss,right_justify]&')
i=winio@('%10?rd["Help text 1 "]&',ii1) !create an edit box and display an integer that can be updated
i=winio@('%ap&',20,3)
i=winio@('%ww[]&')
i=winio@('%co[check_on_focus_loss,right_justify]&')
C this works
i=winio@('%10?rf["Help text 2 "]&',rr1) !create an edit box and display a floating point value that can be updated
C alternatively, the line below also works, but without help text
C i=winio@('%10rf[fmt=10.3f]&',rr1)
C tentative:
C i=winio@('%10?rf["Help text 2 ",fmt=10.3d]&',rr1) !help text string and format together do not work as expected
! help text is truncated at the end and numer is not formatted f10.3
i=winio@('%ap&',40,3)
i=winio@('%ww[]&')
i=winio@('%`bg[red]&') !set background colour
i=winio@('%co[check_on_focus_loss,left_justify]&')
i=winio@('%10?rs["Help text 3 "]&',ss1) !create an edit box and display a character string that can be updated

i=winio@('%ap&',1,7)
i=winio@('%20he&')


c--- Define buttons that are to be dispalyed ---
i=winio@('%2nl %^7bt[&Compile]&',compile)
i=winio@('%2nl %^7bt[&Link]&', link)
i=winio@('%2nl %^7bt[&Run]', run)

C intermediate results output
write(*,*) ii1,rr1,ss1

END
c--- Call-back functions that do nothing ---
INTEGER FUNCTION compile()
compile=1
END
INTEGER FUNCTION link()
link=1
END
INTEGER FUNCTION run()
run=1
END
[/code]
Back to top
View user's profile Send private message Visit poster's website
LitusSaxonicum



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

PostPosted: Fri Dec 10, 2021 10:26 pm    Post subject: Reply with quote

I have downloaded your code and compiled it. Forgive my frankness, but the Help files for FTN95 are not a complete self-tuition manual - ad there are many places where you can simplify your code and make it run the way you want it to.

Please have a look at your private messages.

Eddie
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