I am new to ClearWin+ and have (at present) 2 problems:
PROBLEM 1: I defined a window with three button options. First button enables to choose an input data file, the second one enables to select an output data file, where the input data will be re-written in a new structure (format).
After selecting the input data file, the file name (including path) is displayed in the box below the button (which I required), when the output data file is selected, the filename is NOT displayed in the box below.
I don´t know why, since the code should be OK (see below).
Problem 2. Third button is a combo, where I can select between two options, which are both CHARACTER*1 (z or b).
QUESTION: How can I find out what was selected and assign it to a variable in the main program, which will pass it to a subroutine? I tried to write a call back function, however, I was unable to find, how to pass the selected answer (z or b) within main program to assign it to a variable, which will be passed to a subroutine
Below, my code of the main program follows (without subroutine, which works fine):
WINAPP
PROGRAM TXT_2_SGF_WIN_APP
IMPLICIT NONE
INCLUDE <windows.ins>
EXTERNAL sb_vstup3, sb_vstup4 !, cb_combo
INTEGER ans, w, h, sb_vstup3, sb_vstup4, k, i
CHARACTER*129 subor3, subor4 !str, vstup!, vystup
CHARACTER*1 zmena(2)!, clearwin_string
DATA (zmena(i), i=1,2)/'z','b'/
COMMON subor3, subor4 !str, vstup
w=1000
h=600
subor3='.txt'
subor4='.txt'
call ENABLE_UTF8@(1)
ans=winio@('%sz&',w,h)
ans=winio@('%ww[no_frame,casts_shadow]&')
ans=winio@('%ca[Program: TXT_2_SGF - restructuring original input data to a new data structure]&')
! ! Choose an input data TXT file ! ans=winio@('%3nl%ta%bf%fn[Courier New]Vstup TXT pre SGF:%ta%`^bt[&Vybrať súbor]&','FILE_OPENR[Zvoľ súbor]',subor3,sb_vstup3)
! ! Displaying of the name of the selected input file (including its path) ! ans=winio@('%2nl%ta%ob%80st%cb&',subor3) ! ! Dispalying of the output file name, where newly structured data will be written ! ans=winio@('%3nl%ta%bf%fn[Courier New]Výstup TXT pre SGF:%ta%^bt[&Vybrať súbor]&','FILE_OPENR[Zvoľ súbor]',subor4,sb_vstup4)
ans=winio@('%2nl%ta%ob%80st%cb&',subor4)
! ! Defining whether to change the sign in fron of DX, DY values or not using combo box selection ! where z stands for YES and b stands for NO ! k=1
i=winio@('%3nl%taZmeniť zn. pred DX a DY vo výslednom TXT súbore? (z=áno, b=nie)%`5.2ls',zmena,3l,k)!,clearwin_string(zmena)) !call clearwin_string@('zmena') print *,'znam= ', zmena
END PROGRAM TXT_2_SGF_WIN_APP
INTEGER FUNCTION sb_vstup3() IMPLICIT NONE
CHARACTER*129 subor3, subor4 !str,vstup
INTEGER sb_vstup3
COMMON subor3, subor4 !str, vstup
!vstup=''
! WRITE (subor3,*) subor3
sb_vstup3=2
CALL window_update@(subor3)
END
INTEGER FUNCTION sb_vstup4() IMPLICIT NONE
CHARACTER*129 subor4, subor3 !str,vstup
INTEGER sb_vstup4
COMMON subor4, subor3 !str, vstup
!vstup=''
! WRITE (subor4,*) subor4
sb_vstup4=1
CALL window_update@(subor4)
END
!CHARACTER() FUNCTION CLEARWIN_STRING (zmena) !CHARACTER() zmena !write(clearwin_string,*)zmena !END FUNCTION
!INTEGER FUNCTION cb_combo()
! IMPLICIT NONE
! CHARACTER1 zmena
! CHARACTER129 subor4, subor3
! INTEGER cb_combo
! COMMON subor4, subor3, zmena
! WRITE (zmena,*) zmena
! cb_combo=1 !END