Game Development Community

Denoting a string within a string

by Kevin James · in Torque Game Builder · 03/22/2008 (2:36 pm) · 2 replies

I've been meaning to ask this for a long time! How do you define a string, if its in a string.

ie: I'm using the eval() function, and I need to define a dynamic field as a string within the eval, but I can't because I don't know how to. Erg.

About the author

Computer security, digital forensics, and platform jumper enthusiast. shells.myw3b.net/~syreal/


#1
03/22/2008 (3:07 pm)
// Try this
%object.setFieldValue( %fieldName, %fieldValue );
 
// Or this
eval ( "%object." @ %fieldName @ " = %fieldValue;" );
#2
03/22/2008 (4:08 pm)
Thanks, Phil. I got it working! I've given Unek a break for a while, the movement is getting to me. I've been working on a dialog system for a RPG game. The RPG itself will be my first tongue-in-cheek project. I've been taking myself too seriously. ;)