Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
String Variable
Old
tyler-id
Guest
 
Status:
Posts: n/a
Default String Variable - 05-13-2009, 11:03 PM

I'm having trouble making one.
When I try to set the type of variable to "string", it keeps the type of value that I just had selected. For example, if I clicked on number, and the default value that shows is '1', I try to change the type to string, but the possible values stay as number values, and it doesn't let me click OK unless I change the type back to number.
Any help appreciated.
   
Reply With Quote
Old
HisWorld
Guest
 
Status:
Posts: n/a
Default 05-13-2009, 11:21 PM

Ok after reading you post several times I might understand you question.

Are you saying:
You created a variable of type number and now you want to make it a string.

If you are not trying to do this in a method than this wil never work. Once created you can not change the type of variable, this is true in programming in any language.

As far as requiring there to be some value for a variable of type number this has to do with two idea's in programming. Namely declaring and initializing a variable.

For example if you are programming in C and declare a variable called flower "int examplename" then later on i try to do something like "example = example + 1" The system would crash because though I have declared the variable I have not initialized it with a value.

This may be way beyond what you were asking about so I will reiterate my answer: No you can not change a variable from number to string. You must create a new variable of type string..


Hope this helps!
   
Reply With Quote
Old
tyler-id
Guest
 
Status:
Posts: n/a
Default 05-14-2009, 12:07 AM

Sorry, I was sort of unclear, but that wasn't my question at all.
My problem is that I am unable to create a variable containing a string, and I am wondering if there's some special way to do it and I'm doing it wrong.
   
Reply With Quote
Old
HisWorld
Guest
 
Status:
Posts: n/a
Default 05-14-2009, 07:18 AM

Nope this should be very straight forward.

I will lay out the method in layman's terms to make a variable of type string in Alice.

First have the world object selected in the top left pane.
Next have the properties tab selected
Now click create a new variable
A pop up window appears select "other" for type and ensure string is appear.
Name your string in the top blank and where you see default string give your string its initial value.


This better? If this method doesn't work then your version of Alice isn't working.
   
Reply With Quote
Old
Scott300
Senior Member
 
Status: Offline
Posts: 80
Join Date: Feb 2009
Location: Ohio
Default 05-14-2009, 07:45 AM

The samething happens for me in alice 2.2b running on a 64 bit vista alice 2.0 works fine for me but 2.2b is full of bugs for vista 64 bit =/
  Send a message via AIM to Scott300 Send a message via MSN to Scott300  
Reply With Quote
Old
tyler-id
Guest
 
Status:
Posts: n/a
Default 05-14-2009, 05:51 PM

Yeah, I figured I was doing it right.
I seem to have the same problem as Scott3000.
Thanks for the help, guys.
   
Reply With Quote
cannot create a string variable
Old
hcarol
Guest
 
Status:
Posts: n/a
Default cannot create a string variable - 05-17-2009, 10:44 PM

I am having same problem...simply cannot create a string variable...also, I have the latest version of 2.2
   
Reply With Quote
Reply


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

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.