Go Back   RunUO - Ultima Online Emulation > Developer's Corner > Programming > C#

C# C# Discussion

Reply
 
Thread Tools Display Modes
Old 04-23-2006, 03:37 PM   #1 (permalink)
Forum Expert
 
IHaveRegistered's Avatar
 
Join Date: Jun 2003
Location: Ontario
Age: 20
Posts: 4,519
Send a message via MSN to IHaveRegistered
Default Having a character become a math operator...

Is it possible to have something like this:

Code:
char mathop = '+';

num1 mathop num2 = sum

Just wondering, if it's not I still got a backup (it'll just take longer :P)

Thanks in advance!
__________________
IHaveRegistered is offline   Reply With Quote
Old 04-23-2006, 04:07 PM   #2 (permalink)
Forum Expert
 
arul's Avatar
 
Join Date: Jan 2005
Location: Hiding in your room.
Age: 21
Posts: 1,273
Send a message via MSN to arul
Default

Impossible.
You want to use switch statement, althought there is a way through dynamic code recompiling at the runtime which is slow as hell...
__________________
arul is offline   Reply With Quote
Old 04-23-2006, 04:18 PM   #3 (permalink)
Forum Expert
 
IHaveRegistered's Avatar
 
Join Date: Jun 2003
Location: Ontario
Age: 20
Posts: 4,519
Send a message via MSN to IHaveRegistered
Default

Quote:
Originally Posted by arul
Impossible.
You want to use switch statement, althought there is a way through dynamic code recompiling at the runtime which is slow as hell...
Gotcha, switch/if statements it is :P

Thanks!

PS to Daat, sorry for posting in the wrong spot :P
__________________
IHaveRegistered is offline   Reply With Quote
Old 04-23-2006, 07:05 PM   #4 (permalink)
Forum Expert
 
Courageous's Avatar
 
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
Default

Quote:
Originally Posted by arul
Impossible.
You want to use switch statement, althought there is a way through dynamic code recompiling at the runtime which is slow as hell...
Either dynamic code recompiling, or a custom parser, or some variation of CLR assembly.

C//
Courageous is offline   Reply With Quote
Old 04-23-2006, 09:31 PM   #5 (permalink)
Forum Expert
 
Join Date: Sep 2002
Age: 23
Posts: 1,472
Default

This is probably what you're looking for: click me!
Ravatar is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5