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 

List Select (%ls) - How to get the selection
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Wed Mar 13, 2019 5:37 pm    Post subject: Reply with quote

Nice to know.

Since neither is "portable" (correct?), I guess it doesn't really matter. That said, I like the syntactical completeness of this solution. It is clear what you are doing! The other methods, perhaps not so much.

That said, the pcore7() is still an awesome addition.

I can't get your example to run. It gives me an undefined variable at thge PRINT statement.
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: Wed Mar 13, 2019 7:32 pm    Post subject: Reply with quote

Sorry for the incomplete information. It appears that this is currently for 64 bits only.
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Wed Mar 13, 2019 8:13 pm    Post subject: Reply with quote

Thanks for the update.

Bill
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: Thu Mar 14, 2019 11:42 am    Post subject: Reply with quote

The ALLOCATE keyword argument absolute_address has now been added to 32 bit FTN95 for the next release.
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Thu Mar 14, 2019 3:11 pm    Post subject: Reply with quote

Many thanks. I appreciate the work you all do on getting the compiler and support tools working and bug-free. It's not an easy task, and it is valued.

Bill
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Sat May 18, 2019 2:33 am    Post subject: Reply with quote

Paul,

The following statement gives me a run-time error

i = clearwin_info@('THIS')

Error:
Quote:
Runtime error from program:f:\cmasterf95\checkmate\win32\c-master.exe
Run-time Error
The string THIS
is not known to clearwin_info

COORDINATE_PROCESS_ENABLES - in file ccatalog.for at line 1366 [+0055]
CATLOG - in file ccatalog.for at line 877 [+83d6]
main - in file cmain.for at line 165 [+22ef]


Another alternative to getting the list item selected for a %ls?
Back to top
View user's profile Send private message Visit poster's website
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Sat May 18, 2019 8:30 pm    Post subject: Reply with quote

Bill,
have you set THIS first using ... SET_CLEARWIN_INFO@ ... as it appears to be a user-defined parameter and from the message you get Clearwin_info doesn't recognise it ?

(have you tried using THAT and THEOTHER too Wink )
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Sun May 19, 2019 3:05 pm    Post subject: Reply with quote

John, from Paul's earlier post:
Quote:
Posted: Thu Mar 07, 2019 2:40 pm Post subject: Reply with quote
In the next release of ClearWin+ you will be able to use clearwin_info@("THIS") with %ls.

He is aware of it not working for me (neither installation of 8.50.0).

How about you?
Back to top
View user's profile Send private message Visit poster's website
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Sun May 19, 2019 11:48 pm    Post subject: Reply with quote

Bill, I missed that comment of Paul's, but I couldn't find any mention of option ''THIS'' in the onlinee documentation so I didn't even understand what it's about ! (hence my cryptic comment about THAT and THEOTHER Smile )

I was thinking it was a user-defined parameter hence my suggestion.

In any case I'm still using v8.3 Perso + dlls.

It must have been introduced in v8.4 or 8.5 ? (even though it's obviously not working for you in v8.5)
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Mon May 20, 2019 12:09 am    Post subject: Reply with quote

John,

The addition of %ud has made my life (and programming) soooo much easier. That said, it is still a bit "clumsy" to create a derived TYPE, then populate it with values or pointers to values.

For a %ls,"THIS" in conjunction with %ud: %ud to get the address of an array, then use "THIS" to get the selection that was just made with the %ls. As an example, with those two elements, I can enable/disable controls that are tied to the array (grey control). And, since these constructs can be used generically, one can create a generic callback to handle multiple %ls instantiations that require similar processing. Saves a LOT of time in programming.

For more complex interactions, I can define a derived type that contains data for (or pointers to) elemental types and pass that along to a control. It's better than using a COMMON for data, since a COMMON ties the interactions to specific variables. %ud gets you to a more data independent way of defining the data for, or interaction with, controls.

The only thing that really gets in the way of true data independence is that pointers to character strings must be specified with the string length. The pointer assignment operator does not give one the ability to define the length at run time, although the internal structure of a character string/array pointer does (as far as I have been able to determine) hold the length (and array bounds) as well as the address of the start of the data.

Bill
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: Thu May 23, 2019 4:02 pm    Post subject: Reply with quote

Bill

You only get the current "item selected" when the call back "reason" is either "ITEM_SELECTED" or "ITEM_DOUBLE_CLICKED". Does this explain the failure?
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Thu May 23, 2019 4:18 pm    Post subject: Reply with quote

Paul, no, this did not solve the problem.

The code reads:
Code:
   if(clearwin_string@('CALLBACK_REASON') .eq. 'ITEM_SELECTED') then
      selection = clearwin_info@('THIS') ! get the selection
      print*,'This'
   endif


Thanks for looking at this.
Bill
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: Thu May 23, 2019 4:53 pm    Post subject: Reply with quote

Bill

The following sample works OK for me.

Code:
program listbox
integer,parameter:: num_items=4
integer cur_item
character*8 items(num_items)
integer,external::cb
common cur_item
data items /"Apples","Pears","Oranges","Bananas"/
cur_item = 1
iw = winio@("%^ls",items,num_items,cur_item,cb)
end program

integer function cb()
include <clearwin.ins>
integer selection
integer cur_item
common cur_item 
if(clearwin_string@("CALLBACK_REASON") == "ITEM_SELECTED")then
  selection = clearwin_info@("THIS")
  print*, selection, cur_item
endif 
cb = 2
end function
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Thu May 23, 2019 5:01 pm    Post subject: Reply with quote

The only thing I can think of is that some "aberrent" DLL or LIB is getting used rather than the current one.

I have done a complete directory search of all partitions and find none in the Program Files folder that are out of date.

I also searched the registry for entries (i.e. a registered DLL) and can find none either.

Which lib or dll should I have (i.e. a date/size)? I uninstalled all FTN95 and reinstalled per the instructions you provided. Still, does not work.

This might be related, but Plato32 appears to only reference an older help file (i.e. %ud is NOT in it).
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Thu May 23, 2019 5:21 pm    Post subject: Reply with quote

Looking at the MAP file from the link step, it only refers (at least at link time) to the Silverfrost folder in the Program files directory.
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 Previous  1, 2, 3, 4  Next
Page 2 of 4

 
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