The Daily Click ::. Forums ::. Klik Coding Help ::. Special Characters
 

Post Reply  Post Oekaki 
 

Posted By Message

BBalazs



Registered
  10/07/2004
Points
  41
20th January, 2005 at 12:49:24 -

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?

 
n/a

Zi-Xiao



Registered
  29/07/2002
Points
  537

VIP Member
20th January, 2005 at 14:52:56 -

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

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
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.

 
Old member (~2004-2007).

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
21st January, 2005 at 15:27:22 -

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.

Image Edited by the Author.

 
191 / 9999 * 7 + 191 * 7

BBalazs



Registered
  10/07/2004
Points
  41
23rd January, 2005 at 12:38:41 -

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.

 
n/a

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
23rd January, 2005 at 17:00:51 -

You mean they tell the app to explain, say:

x = 5 * 3

and your app will say:

x = 15

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

 
191 / 9999 * 7 + 191 * 7

Kris

Possibly Insane

Registered
  17/05/2002
Points
  2017
23rd January, 2005 at 17:21:52 -

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

BBalazs



Registered
  10/07/2004
Points
  41
24th January, 2005 at 11:10:53 -

ALT+0178 won't work - that is: ˛

Oh, and yes, though it can currently handle an equation of this form, it doesn't know much:
12x^2+5x-23=0

And it will give you the results and discriminant.

 
n/a

Kris

Possibly Insane

Registered
  17/05/2002
Points
  2017
24th January, 2005 at 11:18:45 -

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

BBalazs



Registered
  10/07/2004
Points
  41
25th January, 2005 at 09:35:25 -

CE region.

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.

 
n/a

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
25th January, 2005 at 13:02:37 -

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.


Put simply, not in MMF 1.5.

 
n/a

Retired Kliker Lazarus

The Ed Wood JR of TDC

Registered
  18/07/2003
Points
  7363
25th January, 2005 at 14:48:56 -

I'm special.

 
Fine Garbage since 2003.
CURRENT PROJECT:
-Paying off a massive amount of debt in college loans.
-Working in television.
   

Post Reply



 



Advertisement

Worth A Click