I want some special characters to be recognised by MMF 1.5, but the problem is that they are Unicode, not ANSI.
For Example, the little two - the square. ²
How can I get it to work?
The string parser object maybe? Never used it before but its supposed to be pretty useful for string/char related stuff
n/a
DaVince This fool just HAD to have a custom rating
Registered 04/09/2004
Points 7998
21st January, 2005 at 10:49:33 -
What about making an extra string object, making the font very small and moving it a bit above the original text? It may not be the best solution, but it's useful for superscript.
And for other special characters, make them active objects and make them appear at a certain time.
What kind of characters are you actually after? Although the square symbol may just be an example, that's one character that's in both unicode and ANSI as far as I'm aware.
It's possible there's a workaround you can use.
Exactly what are you trying to acheive? Does your app need to process files containing unicode characters internally? Does it need to let the user edit such files?
Your best bet in my opinion is the Rich Edit Object. Yes it can display unicode in RTF mode (so it can load RTF files with unicode in, but not unicode txt files). You can also paste in unicode characters by copying them from the character map and pasting them in.
I'll do a bit more research and see if there are any other handy things, but it'd help if you could explain what you need it for?
EDIT:
Right, to insert a unicode character into an RTF document using the Rich Edit Object, you can use the 'Set RTF Text' action. You could do something like this:
[Some Condition]
--Rich Edit: Set Focus This must be done or the app may die, I've found.
--Rich Edit: Set RTF text to "{\u9565?}" This will insert the character.
A bit more detail on the 'inserting character' bit;
Your RTF commands should be surrounded by {curly brackets}. The rest of the code is "\u000?" where 0 is the unicode number of the character. In the above example, it generates one of the box drawing characters.
Another example might be {\u33?}, which creates an exclamation mark. The codes under 255 should be the same as ascii.
The app is supposed to be an algebraic equation-solver program (don't laugh the classmates asked for it). I could use the ^2 symbol, but it's not the best I think.
Is that what it's for? Obviously they'd use it for more complex questions than that I'd figure, but it's a long time since I did textbook algebra, lol.
I think Rich Edit object is your best bet.
I'm assuming you have the user type in the question they have, and maybe press a button to insert a 'squared' or 'cubed' or 'to-the-power' digit. Then you wanna read that doc and find the result as normal?
If you wanna do that, loop through the RTF text using the 'get RTF text' option. This will give you the text in RTF format.
Unfortunately it looks very daunting, but that can't be avoided.
If you type:
x=12*5
You will get:
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
{\colortbl ;\red0\green0\blue0;}
\uc1\pard\cf1\lang2057\f0\fs16 x=12*5}
Lol. Fun!
Stringparser and Fastloop are your friends
The square symbol doesn't need unicode... it's part of ASCII. Press ALT+0178 on the numpad
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G
What region are you from? Maybe your character set doesn't have it
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G
Oh, and not a calculator. This was the reaction I was afraid of
The absolute goal would be to get a program done that writes down every line on how to finish an equation, linear or quadratic, making maths homeworks easy as pie.
MMF only handles ANSI strings, and the Rich Edit object will insert a certain character in place of all Unicode characters. There is no way to even detect it because Unicode characters can be interpreted as null characters if it isn't converted (as it would be for MMF), and that means the end of the string.