Skip to main content
JADarnell
Inspiring
April 3, 2007
Question

IDCS3 PMString to WideString

  • April 3, 2007
  • 2 replies
  • 545 views
CS3 requires us to use WideString for any string objects not getting used in the User Interface. Unfortunately, WideString is nowhere near as capable as PMString. For example, it lacks a GetAsNumber()function, and it also lacks an AppendNumber function. I have gotten around the former by simply doing this:

WideString a("300");
int32 a = (PMString(a)).GetAsNumber();

Can anyone think of a workaround for the AppendNumber() functionality?

TIA!

John
This topic has been closed for replies.

2 replies

JADarnell
JADarnellAuthor
Inspiring
April 4, 2007
Hello Patrick:

Thanks for the information. To my sorrow, I admit that I missed the announcement about using PMString for only UI in CS2. I have written a class that relies heavily on PMString, and alas it will have to be rewritten; a task I am not looking forward to. If I had been paying attention, I would have used the more common basic_string STL class. Unfortunately, I cannot blame anyone but myself.

WRT CS3 itself, the software has been "launched," but not "shipped" according to the InDesign support line. My boss tells me that he has ordered a copy already, so you can purchase it; you just can't receive it.

WRT using this forum, I called Adobe Developer Support (their admin line--I don't believe they have phone support for developer technical questions) and asked the operator if I could post questions to this forum and she said that it would be okay--then she hedged her bet by saying that the worst that would happen is that I would be asked to stop. On the other hand, Mark Nieman-Ross advised me to repost my question on the Prerelease site, so at this point, I admit to some confusion.

Finally, WRT the utils, I took a look at what was available. StringUtils.h deals mostly with PMString manipulation, and some exotic manipulation that didn't look at all relevant to what I was interested in (which is basic Number-to-string translation and vice versa, etc.). IDataString.h has this warning in it:

b Developers should not use these methods unless they are implementing their own incd file format extensions.

So I gave it a broad berth.

If I am missing other string utilities, please let me know.

Its good to hear from you, my friend. I hope all is well in France.

Take care.
John
Known Participant
April 3, 2007
Hi John,

Was final CS3 already released? I am not so sure this is the place to have CS3 issues discussed in open forum like this one.

But is this really a CS3 issue? In CS2 porting guide we were already said that PMString() should only be used in UI if I recall it correctly - and that everywhere else we should use WideString() instead, so there is nothing new in that to me . . .

In my understanding - AppendNumber() & al should become plain utility methods in CS4.

Meanwhile I am still using PMString() for alpha-numerical conversions, then making it a WideString when it seems needed by my implementation.

Alternatively - when single byte text seems appropriate, I am also using sprintf() output from native C strings.

IOW - I don't use one single system to handle all alpha-numerical conversions but decide what would be the less bad solution depending on what my code is actually doing.

This is what I'm doing for CS2 and I am afraid this will remain like this until we'll get in SDK the alpha-numerical convertion utilities we are waiting for from a long time already.

HTH

Best regards

Patrick Perroud