Silverfrost Forums

Welcome to our forums

rf with help text and format

10 Dec 2021 6:54 (Edited: 11 Dec 2021 11:34) #28619

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.

10 Dec 2021 7:06 #28620

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

10 Dec 2021 7:45 #28621

format and help options work individually for %rf, but not together. Thanks for the advice Josef [code] WINAPP INCLUDE <windows.ins> CHARACTER129 file,new_file,help_file CHARACTER10 file_name character5 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&amp;',1,3)                                 !set absolute position for the next control
   i=winio@('%ww[]&amp;')                                   !change style of the window
   i=winio@('%co[check_on_focus_loss,right_justify]&amp;')
   i=winio@('%10?rd[\'Help text 1      \']&amp;',ii1)         !create an edit box and display an integer that can be updated
   i=winio@('%ap&amp;',20,3)
   i=winio@('%ww[]&amp;')
   i=winio@('%co[check_on_focus_loss,right_justify]&amp;')

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&amp;',1,7)
   i=winio@('%20he&amp;')
   

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]

10 Dec 2021 9:26 #28623

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

Please login to reply.