View previous topic :: View next topic |
Author |
Message |
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Wed Mar 13, 2019 5:37 pm Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Wed Mar 13, 2019 7:32 pm Post subject: |
|
|
Sorry for the incomplete information. It appears that this is currently for 64 bits only. |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Wed Mar 13, 2019 8:13 pm Post subject: |
|
|
Thanks for the update.
Bill |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Thu Mar 14, 2019 11:42 am Post subject: |
|
|
The ALLOCATE keyword argument absolute_address has now been added to 32 bit FTN95 for the next release. |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Thu Mar 14, 2019 3:11 pm Post subject: |
|
|
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 |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Sat May 18, 2019 2:33 am Post subject: |
|
|
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 |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Sat May 18, 2019 8:30 pm Post subject: |
|
|
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 ) _________________ ''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 ... " |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Sun May 19, 2019 3:05 pm Post subject: |
|
|
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 |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Sun May 19, 2019 11:48 pm Post subject: |
|
|
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 )
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 ... " |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Mon May 20, 2019 12:09 am Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Thu May 23, 2019 4:02 pm Post subject: |
|
|
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 |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Thu May 23, 2019 4:18 pm Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Thu May 23, 2019 4:53 pm Post subject: |
|
|
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 |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Thu May 23, 2019 5:01 pm Post subject: |
|
|
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 |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Thu May 23, 2019 5:21 pm Post subject: |
|
|
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 |
|
|
|