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 

%ac with PLUS or MINUS key
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
dpannhorst



Joined: 29 Aug 2005
Posts: 165
Location: Berlin, Germany

PostPosted: Fri Nov 13, 2009 10:50 am    Post subject: %ac with PLUS or MINUS key Reply with quote

What is the standard character string to use PLUS or MINUS key as an accelerator key?
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: Thu Nov 19, 2009 4:45 pm    Post subject: Reply with quote

I suppose no answer means that no-one ever did it! Seems like a reasonable question to ask, so I replied just to keep the thread alive. Indeed, what are the strings for all keys - and how do they change for other language keyboards?

Eddie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Thu Nov 19, 2009 6:08 pm    Post subject: Reply with quote

Here is the list of special cases at the moment. Anything else can be added for the next release. I guess that you have tried "+" but you may have to combine it with (say) "ctrl" for it to work. I will run some tests when I get a minute.

"enter", VK_RETURN,
"esc", VK_ESCAPE,
"tab", VK_TAB,
"home", VK_HOME,
"end", VK_END,
"del", VK_DELETE,
"ins", VK_INSERT,
"pgup", VK_PRIOR,
"pgdn", VK_NEXT,
"left", VK_LEFT,
"up", VK_UP,
"right", VK_RIGHT,
"down", VK_DOWN,
"f1", VK_F1,
"f2", VK_F2,
"f3", VK_F3,
"f4", VK_F4,
"f5", VK_F5,
"f6", VK_F6,
"f7", VK_F7,
"f8", VK_F8,
"f9", VK_F9,
"f10", VK_F10,
"f11", VK_F11,
"f12", VK_F12,
"backspace", VK_BACK,
"keypad_centre",VK_CLEAR,
"space", VK_SPACE
Back to top
View user's profile Send private message AIM Address
dpannhorst



Joined: 29 Aug 2005
Posts: 165
Location: Berlin, Germany

PostPosted: Thu Nov 19, 2009 6:58 pm    Post subject: Reply with quote

I have tried these combinations already:

Ctrl+PLUS
Ctrl+Plus
Ctrl++

But nothing is working.

Detlef Pannhorst
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Fri Nov 20, 2009 9:47 am    Post subject: Reply with quote

For the next release I have added Ctrl++.

Also

Ctrl+- (i.e. minus)
Ctrl+<
Ctrl+>
Ctrl+?
Ctrl+@

If there is anything else then please ask because for the moment each special character has to be added to a table.
Back to top
View user's profile Send private message AIM Address
dpannhorst



Joined: 29 Aug 2005
Posts: 165
Location: Berlin, Germany

PostPosted: Fri Nov 20, 2009 10:30 am    Post subject: Reply with quote

Thanks, that could be interesting for other users also.

Detlef Pannhorst
Back to top
View user's profile Send private message Visit poster's website
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Thu Nov 26, 2009 6:58 am    Post subject: Reply with quote

Yes, plus and minus are good additions.

- Paul, not that i extremely need them right now (and i can still use all the keys at least partially via other ways, like get_wkey@ or via Windows messaging like you showed recently) but just to be general, how about:
~
` grave accent
numbers 0-9
! @ # $ % ^ & * ( ) _ - = \ ? > < /: ;

- Also adding Clearwin basic colors besides just four (red, yellow, green and blue, and also white, gray, black) add some others (like light and dark of those above and also brown, cian, magenta etc). Can for example %gr be dark gray or light blue ?

- Adding bitmap background to %gr would be nice (i've made this myself a bit more complex way but it's real cool)

- You have the whole bunch of nice routines for communication with serial ports. Adding TCP/IP streaming functions to communicate with the servers same way would be nice too. The Winsock, Winscok2 and Wininet are hell difficult for pure fortraneers to adapt themselves


Last edited by DanRRight on Thu Nov 26, 2009 4:10 pm; edited 1 time in total
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Thu Nov 26, 2009 8:14 am    Post subject: Reply with quote

OK. The wish list has grown quite dramatically.
Can you provide a recommended order of priority?
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Sun Dec 06, 2009 9:26 pm    Post subject: Reply with quote

To me %ac and %gr additions are of minor necessity.

The client-server option would be major one - to allow the fortran code to exchange the requests and data with the servers.

Ideally conceptually they have to look like these ones which were made for serial ports #1-4 even in FTN77 ( and such functionality was literally shocking for most of fortraners )

OPENCOMMDEVICE@ Opens a serial port for I/O.
READCOMMDEVICE@ Reads data from an open serial port.
SETECHOONREADCOMM@ Sets the communication port to echo back to the sending device.
SETYIELDCOMM@ Configures READCOMMDEVICE@ to yield to other applications when waiting for data.
WRITECOMMDEVICE@ Writes a string to a serial port.

Client-Server functionality will make two or more fortran programs exchange data via TCP/IP port. All programs of course could be running in the same computer and use 127.0.0.1 internal address. The functionality can for example resemble what the Swiss knife of client-server interaction Netcat is allowing, which is very intuitive - the server opens the port and client program uses READ_URL@('127.0.0.1:12345/doSomething', file, err) for example to both sending the request and getting the data from port 12345 (in this case asynchronously). If to add to READ_URL@ an option that it does not wait for the data for some time - several seconds - and just sends request and quits, this would be already sufficient for most of tasks.

But of course additional *streaming* functionality via TCP/IP would be an ideal ultimate goal - in this case both client and server after connection exchange the data synchronously when client knows the server is sending something and acts immediately. You definitely know better then me how it works, i just write a bit more verbose so that others understand me better.

Other colleagues-fortraners may be still did not think about advantages of this because there was no such thing pre-programmed for them in FTN77/95 or other fortran compilers. Intel IVF has socket interface but as usually it is not done conveniently and easy like developers of this compilers always do - just look at the serial port functions above. The result with IVF is that no single person knows how to use sockets, and even if one-two know (just try to find them), everything is so damn complex there - in FTN95 one line - in IVF two pages of highly cryptic text. Again compare one line RED_URL@ with their read URL code Mad ) . In short, it will work similarly but more efficiently - the client sends the request, the server gets it immediately, deciphering it and reacts by sending back to the same port (or another) the data needed. Then client finds the data is coming, gets it, asks something else ...and so on...Multiprocessing also will be easily done for some tasks. Or 2GB barrier of compiler will be easy to overcome by spreading the massive data (and CPU load) over N processors and threads. I even not saying about advantages of internet connection of your fortran code to everything in the world
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Mon Dec 07, 2009 9:18 am    Post subject: Reply with quote

Thanks for this. I can have a look to see if this addition can be made. Realistically I cannot see my doing this before the new year so it might be a good idea to remind me at that time.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Mon Jan 11, 2010 12:41 pm    Post subject: Reply with quote

I have had a brief look at the best approach for adding TCP/IP streaming functions for use with FTN95.

My first thought was that there must be a free Winsock interface library somewhere on the internet together with an appropriate DLL that could be accessed from FTN95. I have had a look and cannot find one. Has anyone seen such a thing?

Adding a set of functions to our library would be a big job.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Wed Jan 13, 2010 4:06 pm    Post subject: Reply with quote

I think the interface exists in your competitor Intel IVF compiler (i do not have one, i have previous 10 years old version of Compaq VF somewhere but most probably Wininet and Winsock are still not there). As an example and a proof here is the code written with the pain by the whole Fortran newsgroups community in two months in IVF using these Winsock or Wininet functions (which is all equivalent to just one line in Clearwin i=READ_URL@(URL, file, err) ). Author - Dave Frank
Code:

PROGRAM GETFILE  ! CVF compiler source, program gets internet file
IMPLICIT NONE    ! Compile:  >DF GETFILE.F90 /LINK WININET.LIB

INTERFACE  ! to 4 WinInet API functions contained in WININET.DLL

INTEGER FUNCTION InternetOpen [STDCALL,ALIAS:"_InternetOpenA@20"] &
                             (sAgent, nAccessType, sProxy, sBypass, nFlags)
 INTEGER :: nAccessType, nFlags
 CHARACTER(*) :: sAgent[REFERENCE], sProxy[REFERENCE], sBypass[REFERENCE]
END FUNCTION

INTEGER FUNCTION InternetOpenUrl [STDCALL,ALIAS:"_InternetOpenUrlA@"] &
                                (hInternet,sUrl,sHeaders,nHeadersLength,nFlags,nContext)
 INTEGER :: hInternet, nHeadersLength, nFlags, nContext
 CHARACTER(*) :: sUrl[REFERENCE], sHeaders[REFERENCE]
END FUNCTION

INTEGER FUNCTION InternetReadFile [STDCALL,ALIAS:"_InternetReadFile@16"] &
                                 (hFile, sBuffer, nBytesToRead, nBytesRead)
 INTEGER :: hFile, nBytesToRead, nBytesRead[REFERENCE]
 CHARACTER(*) :: sBuffer[REFERENCE]
END FUNCTION

INTEGER FUNCTION InternetCloseHandle [STDCALL,ALIAS:"_InternetCloseHandle@4"] (hInet)
 INTEGER :: hInet
END FUNCTION

INTEGER FUNCTION Nargs()   ! returns #args from command line
END FUNCTION
END INTERFACE

INTEGER,PARAMETER ::         &
NLEN            = 10000,     &  ! InternetReadFile #bytes requested/call
RELOAD          = #80000000, &  ! retrieve the original item
PASSIVE         = #08000000, &  ! used for FTP connections
NO_CACHE_WRITE  = #04000000, &  ! don't write this item to the cache
KEEP_CONNECTION = #00400000, &  ! use keep-alive semantics
IGNORE_TO_HTTP  = #00008000, &  ! ignore REDIRECT ex: https:// to http://
IGNORE_TO_HTTPS = #00004000, &  ! ignore REDIRECT ex: http://  to https://
RESYNCHRONIZE   = #00000800, &  ! asking wininet to update an item if it is newer
TRANSFER_BINARY = #00000002, &  !
FLAGS = NO_CACHE_WRITE  + KEEP_CONNECTION + RESYNCHRONIZE + RELOAD + PASSIVE + &
        TRANSFER_BINARY + IGNORE_TO_HTTPS + IGNORE_TO_HTTP

CHARACTER(14),PARAMETER :: sAgent = 'my wininet app'
CHARACTER,POINTER :: vfNullString=>NULL()

! - - - Local Variables - - -
INTEGER :: i, n, hSession, hUrl, nBytesRead, nTotalBytes
LOGICAL :: ok, keyin, suppress
CHARACTER(NLEN) :: sBuffer, sUrl*80, filename*20
! - - - - - - - - - - - - - -


Last edited by DanRRight on Thu Jan 14, 2010 5:09 am; edited 6 times in total
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Wed Jan 13, 2010 4:09 pm    Post subject: Reply with quote

continuation

Code:

! - - - - - - - - - - - - - -
1  keyin = .FALSE. ; suppress = .FALSE.

IF (Nargs() > 1) THEN             ! get url link from command line
   CALL GetArg(1, sUrl)
   IF (Nargs() > 2) suppress = .TRUE.  ! dont output successful messages
ELSE                              ! get url link from keyin
   WRITE (*,91) 'ENTER URL or hit <ENTER> to EXIT at >'
   WRITE (*,'(A\)') '>'
   READ (*,91) sUrl
   IF (sUrl == ' ') STOP
   keyin = .TRUE.
END IF
IF (sUrl(1:4) /= 'http'.AND.sUrl(1:3) /= 'ftp') THEN
   WRITE (*,91) 'GETFILE: URL doesnt begin with http OR ftp '
   GO TO 100
END IF
n = LEN_TRIM(sUrl)
DO i = n,4,-1                        ! scan back to find filename start
   IF (sUrl(i:i) == '/') EXIT
END DO
i = i+1
IF (sUrl(i:i+3) == 'www.') i = i+4   ! dont include 'www.' in filename
filename = sUrl(i:)                  ! note: filename is len=20 string
IF (.NOT.suppress) WRITE (*,91) 'GETFILE: ' // TRIM(filename) // '  FROM  ' // sUrl(1:i-1)

hSession = InternetOpen (sAgent, 0, vfNullString, vfNullString, 0)
IF (hSession == 0) THEN
   WRITE (*,91) 'GETFILE: FAILURE to get session handle'
   GO TO 100
END IF

sUrl = TRIM(sUrl) // CHAR(0)
hUrl = InternetOpenUrl (hSession, sUrl, CHAR(0), 0, FLAGS, 0)
IF (hUrl == 0) THEN
   WRITE (*,91) 'GETFILE: OPENURL FAIL'
   ok = InternetCloseHandle (hSession)
   GO TO 100
END IF

OPEN (1,FILE=TRIM(filename),FORM='BINARY')
nTotalBytes = 0
DO
   nBytesRead = 0
   ok = InternetReadFile (hUrl, sBuffer, NLEN, nBytesRead)
   IF (nBytesRead == 0) EXIT
   WRITE (1) sBuffer(1:nBytesRead)
   nTotalBytes = nTotalBytes + nBytesRead
   WRITE (*,'(1X,I0,2A\)') nTotalBytes/1000,'kb',CHAR(13) ! show progress
END DO
ok = InternetCloseHandle (hSession)

IF (nTotalBytes < 500) THEN   ! server rejection text is < 500 bytes
   WRITE (*,91) 'GETFILE: FAILURE < 500 bytes FILE is DELETED'
   CLOSE (1,STATUS='DELETE')
ELSE
   IF (.NOT.suppress) WRITE (*,91) 'GETFILE: SUCCESS #bytes = ',nTotalBytes
   CLOSE (1)
END IF

100 IF (keyin) GO TO 1   ! continue, exit only via blank<enter> keyin
STOP
91 FORMAT (A,I0)
END PROGRAM

Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Thu Jan 14, 2010 8:53 am    Post subject: Reply with quote

This particular piece of coding could be replicated quite easily for FTN95. You only have to change the interfaces to the API. The FTN95 help file describes how to do this. A search for STDCALL in the help file should do the trick.
Back to top
View user's profile Send private message AIM Address
dpannhorst



Joined: 29 Aug 2005
Posts: 165
Location: Berlin, Germany

PostPosted: Fri Mar 19, 2010 8:50 am    Post subject: Accelerator + and - Reply with quote

I have just checked the use of + and - key as an accelerator with the new compiler version 5.50. Unfortunately it is not working with the + and - key of the numeric keypad.

Detlef
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
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