Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

thread184-1059928 Hi Mike How d

Status
Not open for further replies.

nlsilva

Programmer
Dec 1, 2023
4
PH
thread184-1059928
Hi Mike

How do solved the problem on AMembers function returning a Upper case string?

Thanks,

NLSilva
 
If that bothers you, I don't think there are any other ways than creating a table on your own with all the values the way you want it, and then scan the array and replace the values.
 
Hello NLSilva and welcome to the forum.

The solution can probably be found in the thread that you quoted. In particular, look at my post dated "20 May 05 03:34" regarding fdkeywrd.dbf in the Wizards directory.

If that doesn't answer your question, perhaps you could clarify exactly what you need to know.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Mike,

I need a function semilar with Amembers that will return properties in it original case not in upper case letters.

thanks,

NLSilva
 
NLSilva,
Can you explain what you're trying to achieve? Why is the case of the properties important? There may be another way to do what you're trying to do if we understand what your objective is, and why you think you need the properties case.


Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCAP, CDCP, CDCS, CDCE, CTDC, CTIA, ATS, ATD

"I try to be nice, but sometimes my mouth doesn't cooperate.
 
Hi Scott,

I'm using this to communicate with an Bank terminal running on Android OS, there application is case sensitive.

So what ever I store on an object and retrieve it using a function (like AMembers) it should return the name that is not on a upper case.

Hope I answer your question.


regards,

NLSILVA
 
Well, then fdkeywrd.dbf won't help you, which Mike mentions as the solution of the thread184-1059928.
That only contains the right casing of Foxpro keywords, not of any object.

Indeed using external things like OLE or even just the Windows API functions, you need code to comply to the case of method or property names.

If the objects you get are COM objects, AMEMBERS will give the PEMs in correct case using AMEMBERS(arrayname, object, 3) - the third parameter must be 3 for OLE/COM objects or you get nothing at all.

If it's nopt OLE/COM objects, I don't know how you can get case sensitive property names programmatically, sorry.

Chriss
 
See my earlier reply, that's the easiest solution, since it's easy to add more words whenever that is necessary. This table only needs to contain the list of critical words, which hopefully won't be that long.

Or maybe you don't need to use Amembers at all?
 
I think you have misunderstood what AMEMBERS() does. It does not return the value of a property, but rather the name of the property. Just try running this in the command window, and you will see what I mean:

Code:
? AMEMBERS(laArray, _screen)
DISPLAY MEMORY LIKE laArray

Is that really what you want?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike,

when did he say he wants the values of things, but names.
nlsilva said:
it should return the [highlight #FCE94F]name[/highlight] that is not on a upper case

Chriss
 
Rick Strahl has written about the problem specifically in a Javascript scenario here:
So if this interface to the bank terminal on Android is via Javascript, you better solve that within Javascript as a layer between VFP and the android app or whatever that is.

And to get a handle on this in VFP you should do what Rick Strahl has identified to work: Define the methods and properties VFP should be able to address in all lower case.

Chriss
 
What kind of objects do you need to address, is it Javascript?

I was reminded of this thread about JSON and AMEMBERS, which was about the order of properties: thread184-1812811
There's also the discussion point about json libraries and I mention Object.keys(obj)as a way to get at the property names within JS and I guess there are similar self reflection functionalities in whatever other language your problematic objects originate from, which can be used.

Chriss
 
Hi Chriss,

Yes I was using it for JSON, but for I don't need the sorting I just need the original case of the property name.

Thanks guys for your suggestion.

Regards
 
When you turn JSON into a VFP object property name case doesn't matter anymore,
so I can only imagine it's about turning VFP objects back into JSON with the original case sensitive names.

Is it that?

It's not impossible to change whatever JSON parser you use to not only generate VFP properties but also store the original name in a table that Tore suggested early on.


Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top