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 

*** WINIO@ cannot process REAL(KIND=1) arguments, only .....

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



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

PostPosted: Mon Apr 01, 2013 7:59 pm    Post subject: *** WINIO@ cannot process REAL(KIND=1) arguments, only ..... Reply with quote

This is more like a suggestion/question/request. Sometimes controls have a lot, say, 20 of arguments, and when the error like the above occurs you always guess which one is wrong shuffling the large code back and forth to check if all 20 were declared properly.

Can the compiler tell exactly which argument it is not happy with? For his digital mind it is simpler then for our analog ones. He (well, it) probably can even fix the problem himself in no time asking you "Want me add REAL*8 statement for ABC and also declare the FuncA as an external?" and you just answer "Sure, go" Smile

(And on April 1 all compiler diagnostics messages must be misleading and humorous. "You have got an integer underflow error on line 1223653..." "Floating point overflow in character A10 format"Smile Do that and this compiler will be #1 till year 3000.

Returning to my sheeps, so which damn argument out of 18 could be possibly wrong?)
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Apr 02, 2013 8:06 am    Post subject: Reply with quote

I can have a look.

A good practice is to winio@ continuation. If a format code needs arguments then give it its own winio@.
Back to top
View user's profile Send private message AIM Address
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Tue Apr 02, 2013 8:28 am    Post subject: Reply with quote

Dan,

I agree with Paul. I modified your last example to better understand what you did. (Works like you reported)
Code:
   winapp
   use clrwin
   common    i1,i2,i3, j1,j2,j3
   integer   i1,i2,i3, j1,j2,j3
   integer   cb, i
   external  cb
   save
!
   i = winio@ ('%ww&')
   i = winio@ ('%ac[esc]&','exit')
!
   i = winio@ ('Add two numbers %ta%6^rd&',      i1,cb)
   i = winio@ (' + %6^rd&',                      i2,cb)
   i = winio@ (' = %6rd&',                       i3)
   i = winio@ ('%ff&')
!
   i = winio@ ('Add two numbers %ta%dd%4^rd&',   1,j1,cb)
   i = winio@ (' + %dd%4^rd&',                   1,j2,cb)
   i = winio@ (' = %6rd&',                       j3)
   i = winio@ ('%ff')

   end

   integer function cb()
   use clrwin
   common    i1,i2,i3, j1,j2,j3
   integer   i1,i2,i3, j1,j2,j3
!
     i3=i1+i2
     j3=j1+j2
     call window_update@ (i3)
     call window_update@ (j3)
   cb=1
   end function cb

John
Back to top
View user's profile Send private message
DanRRight



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

PostPosted: Tue Apr 02, 2013 6:08 pm    Post subject: Reply with quote

That would increase our code length by 34734 lines LOL
And make hell out of large codes readability because typically controls are combined to accomplish the same goal and are the reflection of the most convenient style of particular programmer. But for posting here i agree it is probably always worth adding some syntactic sugar. Yes, i know that my programming style is as bad as my English :-/

It has some advantages though. You probably remember that it comes from the concept expressed in this 1-line 132-character code
Code:
i=winio@('%ww%mi[i]%ca[win]%wp[a]%mn[File[Exit]]%th%dd%il%cn%`bg[yellow]%?7rd[index]%ff%nl%cn%^bm[e]%ff','exit',1,1,0,10,j,'exit')
 end


which looks like that



or the same without using any graphics resources

Code:
i=winio@('%ww%ca[CWP]%mn[File[Exit]]%th%dd%il%cn%`bg[yellow]%?7rd[index]%ff%nl%cn%tt[exit]%ff','exit',1,1,0,10,j)
end


Simpler way this will look like this (but this will not be simpler when already large source length explodes )
Code:
use clrwin
imlicit none
integer i
integer j
i=winio@('%ww&')
i=winio@('%mi[i]&')
i=winio@('%ca[win]&')
i=winio@('%wp[a]&')
i=winio@('%mn[File[Exit]]&','exit')
i=winio@('%th&')
i=winio@('%dd&',1)
i=winio@('%il&',1,0,10)
i=winio@('%cn&')
i=winio@('%`bg[yellow]&')
i=winio@('%?7rd[index]&',j)
i=winio@('%ff&')
i=winio@('%nl&')
i=winio@('%cn&')
i=winio@('%^bm[e]&')
i=winio@('%ff')
stop
end
 resources
  a bitmap a.bmp  ! wallpaper
  e bitmap e.bmp  ! Exit button
  i icon   i.ico        ! icon


And when you program the GUI which have many controls in single line like here



you naturally tend to assemble them in the Fortran text similar way otherwise you will not find anything quick. That finalizes often as a dozen of variables in the single line with many continuation lines


Last edited by DanRRight on Fri Apr 05, 2013 4:06 am; edited 5 times in total
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Tue Apr 02, 2013 9:14 pm    Post subject: Reply with quote

Dan,

As your application program has multiple windows, presumably they all have common features that can be wrapped up in a subroutine, for example, as in:

Code:
      CALL WINDOW_SETUP (CAPTION_TEXT)


where

Code:
      SUBROUTINE WINDOW_SETUP (CAPTION_TEXT)
      INCLUDE <WINDOWS.INS>
      CHARACTER*(*) CAPTION_TEXT
      ... clearwin+ calls
      RETURN
      END


WINIO@ continuations can go across subroutine calls. This can save you a lot of lines.

When you specify a mimimise_icon with %mi you are also giving the window a system menu, which may bypass your attempts to make the window fixed size. The Windows standard is not to give this icon for modal windows (i.e. those that must be closed before the program continues).

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


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

PostPosted: Wed Apr 03, 2013 8:00 am    Post subject: Reply with quote

I would not use a new winio@ for every format code, only for those that have arguments.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



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

PostPosted: Wed Apr 03, 2013 10:54 am    Post subject: Reply with quote

Paul,

That was a helpful suggestion I have already decided to adopt in new code - certainly having multiple format codes requiring parameters make the WINIO@ rather complicated, as it is already difficult enough remembering (for example) where the grey-out code comes, let alone all the other options! Of course the shorter each statement is, the less and less need there is to approach column 72. Very few of my statements do, probably because if they get that far I know that they will be difficult to decipher 10, 20 or more years hence. My oldest code I use regularly is now 43 years old, and I have learnt a lot since then. One thing I am certain of is that I will not need to understand today's code in another 43 years ....

The one thing I forgot to say when recommending splitting Clearwin+ WINIO@ calls across subroutines is that they need to be explicitly SAVEd or there is a chance of the application crashing when closing down one or more windows: this is an application crash, not an FTN95/Clearwin+ crash, i.e. the system emits an appropriate message, but one that isn't helpful to a user who has just lost their work!

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



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

PostPosted: Thu Apr 04, 2013 12:44 am    Post subject: Reply with quote

Is it impossible to compiler to tell exactly which variable is of wrong type?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Apr 04, 2013 8:01 am    Post subject: Reply with quote

I have noted this as something to investigate.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Fri Aug 09, 2013 5:18 pm    Post subject: Reply with quote

I have had a look at this suggestion.

ClearWin+ error messages already provide the argument number of an unexpected argument.

Can you supply an example of an error condition where the argument number is not reported?
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



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

PostPosted: Fri Aug 09, 2013 5:28 pm    Post subject: Reply with quote

Paul,

I think Dan was hoping for the name of the variable!

I find it useful to keep track of what number continuation I am dealing with in several ways:

1. By dividing the WINIO@s for really complicated windows over a number of subroutines, as the error always gets the subroutine name for you
2. By having few parameters in WINIO@ invocations
3. By remembering to now and then put the continuation number in the code using an inline comment, e.g.

Code:
      IA=WINIO@('%si!Beware the Jaberwock, my son&') ! continuation 60


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


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

PostPosted: Sat Aug 10, 2013 7:18 am    Post subject: Reply with quote

I suppose that, in theory, it could be done!
FTN95 could export a database that ClearWin+ could then access when an error occurs.
Back to top
View user's profile Send private message AIM Address
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