NewMap Country.s()
Country("US") = "United States"
Country("FR") = "France"
Country("GE") = "Germany"
If FindMapElement(Country(), "US")
Debug "'US' is in the country list."
Debug country()
Else
Debug "'US' is NOT in the country list !"
Debug Country()
EndIf
If FindMapElement(Country(), "UK")
Debug "'UK' is in the country list."
Debug Country()
Else
Debug "'UK' is NOT in the country list !"
Debug Country()
EndIf
If FindMapElement(Country(), "FR")
Debug "'FR' is in the country list."
Debug Country()
Else
Debug "'FR' is NOT in the country list !"
Debug Country()
EndIf
My question is about the pointer it returns when it finds an element. Is it a pointer to a pointer? I've never used it. I was wondering if anyone has an example without using a map of structures just a plain simple map.
NewMap Country.s()
Country("US") = "United States"
Country("FR") = "France"
Country("GE") = "Germany"
If FindMapElement(Country(), "US")
Debug "'US' is in the country list."
Debug country()
Else
Debug "'US' is NOT in the country list !"
Debug Country()
EndIf
If FindMapElement(Country(), "UK")
Debug "'UK' is in the country list."
Debug Country()
Else
Debug "'UK' is NOT in the country list !"
Debug Country()
EndIf
If FindMapElement(Country(), "FR")
Debug "'FR' is in the country list."
Debug Country()
Else
Debug "'FR' is NOT in the country list !"
Debug Country()
EndIf
*ptr.string =FindMapElement(Country(), "US")
If *ptr
Debug *ptr\s
Debug Country()
EndIf
I was overthinking the object situation. No more coffee for me.
Thank you.
Norm.
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
normeus wrote: Thu Mar 14, 2024 11:28 pm
Thank you idle!
So this would be an example of the element changing and the usage of the pointer returned by FindMapElement()
NewMap Country.s()
Country("US") = "United States"
Country("FR") = "France"
Country("GE") = "Germany"
If FindMapElement(Country(), "US")
Debug "'US' is in the country list."
Debug country()
Else
Debug "'US' is NOT in the country list !"
Debug Country()
EndIf
If FindMapElement(Country(), "UK")
Debug "'UK' is in the country list."
Debug Country()
Else
Debug "'UK' is NOT in the country list !"
Debug Country()
EndIf
If FindMapElement(Country(), "FR")
Debug "'FR' is in the country list."
Debug Country()
Else
Debug "'FR' is NOT in the country list !"
Debug Country()
EndIf
*ptr.string =FindMapElement(Country(), "US")
If *ptr
Debug *ptr\s
Debug Country()
EndIf
I was overthinking the object situation. No more coffee for me.
Thank you.
Norm.
I need coffee today or maybe I skip and straight to the wine!