Hi Luis,
Thanks again for your detailed reply and for spending so much time on my query.
Firstly though, I have read the manual, but like most software manuals this is written for users who understand the language.
I have not used a "Windows" language before and so found it very difficault to understand the concepts.
Luckilly I discovered the Pure Basic book by Gary Willoughby.
So I am now at the experimenting stage.
That said, I still don't have a good "feel" for the language and so I can't spot errors that would be simple for experienced users.
The problem with the *ptr/s mentioned in my earlier post is a good example.
I had copied your code example, but in my code I had defined the *ptr.string in the code for adding values to the list, whereas it appears that it has to be in the code to return the values from the list.
When I don't define it in the code to return the values, I get the error mentioned in my post about the variable *ptr not having a structure. Note that the error message doesn't say how to correct this.
I read about pointers in the manual and I didn't seem to find anywhere the reasons as to why you might use them!!
Anyway, once I had the define statement in the correct location my application worked except for one last issue.
I cannot get the correct return value !!
Here is code to populate the list:
Code:
ForEach lAvevaLauncherServers()
; Add values displayed in list
If FindMapElement(lAvevaLauncherServers()\Data(), "displayname")
If lAvevaLauncherServers()\Data("status") = "Y" Or (lAvevaLauncherServers()\Data("status") = "A" And bAdminUser = "1")
AddGadgetItem(Gadget_Form1_ListView8,-1,lAvevaLauncherServers()\Data("displayname"))
Debug lAvevaLauncherServers()\Data("displayname")
Debug lAvevaLauncherServers()\Data("shortname")
*ptr = FindMapElement(lAvevaLauncherServers()\Data(), "shortname") ; address of the data
Debug *ptr
SetGadgetItemData(Gadget_Form1_ListView8,-1, *ptr) ; store it
EndIf
EndIf
Here is the code to return the list value:
Code:
Select EventType()
Case #PB_EventType_LeftDoubleClick
Default
Item = GetGadgetState(Gadget_Form1_ListView8)
Debug Item
*ptr = GetGadgetItemData(Gadget_Form1_ListView8,Item) ; get it
Debug *ptr
Debug *ptr\s
EndSelect
Here is the debug output:
; Populate the List
: all seems ok - new *ptr values for each item
Melbourne Aveva Licence Server
MEL01
22560308
Dortmund Aveva Licence Server
DTM01
22562380
Dortmund Review Machine
DTM02
22562676
Bad Soden Aveva Licence Server
BDS01
22563268
; Try and get list value
; Select each item in the list
0
22563268
BDS01
1
22563268
BDS01
2
22563268
BDS01
3
22563268
BDS01Note that even though the item returned is corrrect, GetGadgetItemData() always returns the same *ptr number !!
It looks as though the values stored in the code to populate the list are incorrect.
I'm sure that it is something simple as usual, but I'm afraid that I can't see it.
Thanks,
Neil