text attribute to integer or real attribute converter?
GamePizza
Member, PRO Posts: 227
Is there a built in function to convert a text attribute to an integer or real attribute?
For instance if I have a text attribute of '127'. Can I convert this into the integer attribute 127 or real attribute 127.0?
For instance if I have a text attribute of '127'. Can I convert this into the integer attribute 127 or real attribute 127.0?
Answers
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
… and numbers are numbers no matter what type of storage for their value
… text of only numericalCharacters store as text number values
add an attribute: integer, real, index (or a table columns for integer or real)
those attributes can be changed to any textAttribute that consists only of numericalCharacters
(with/without decimals)
try this with the actor's name: 127.35
and change the integer or real attribute to the actor's name
MH
Hi @GamePizza
Or you can simply convert it by putting the text value into the appropriate new attribute, and this will convert it accordingly, providing it's a number. If the value in the Text attribute is text, the result will be 0.
So say you have your Text attribute, integer and real attributes. Let's make the text attribute's value 127.0 as per your example. So:
Change attribute IntAtt to TextAtt
--will make the value of IntAtt 127
Change attribute RealAtt to TextAtt
--will make the value of RealAtt 127.0
Maybe that'll be useful for you.
----------------------------------------------
http://davidgriffinapps.co.uk/
PS Does anyone know where I can put the above address in the proper forum signature form? I'm blowed if I can find out where that is.... I've looked three times or more in my Profile and Settings...
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
should see Edit Forum Profile next to View GS Profile
click that Edit
on the right side under your avatar
click Signature Settings
why it is so hidden? … I don't know! #-o
MH
@MotherHoose
Hiya MH, Nor do I now!! Thanks - I was looking for it in the drop down menu when clicking my username top right... so.... why didn't I think of clicking on my actual name used in posts? ... I don't know! #-o
:-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps