Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Dec 14, 2019 8:00 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Remember Info
PostPosted: Sun May 10, 2009 1:43 pm 
Offline
User avatar

Joined: Wed Dec 10, 2008 3:51 pm
Posts: 27
How do I make RealBasic remember a piece of info for the programs session? I want to have the player enter in a name into an editfield, then later on have to recall what they entered in.

Thanks,
Frankoman

_________________
Experience is the Teacher of all Knowledge ~ Julius Caesar


Top
 Profile  
Reply with quote  
 Post subject: Re: Remember Info
PostPosted: Sun May 10, 2009 2:15 pm 
Offline

Joined: Fri Sep 30, 2005 9:29 am
Posts: 732
Location: California
Just while the application is running?

Make a property in the App class, and set it to either Global or Protected.

When the user enters their name set the App property to that value. Then you just reference that property as needed.


Top
 Profile  
Reply with quote  
 Post subject: Re: Remember Info
PostPosted: Sun May 10, 2009 2:42 pm 
Offline
User avatar

Joined: Wed Dec 10, 2008 3:51 pm
Posts: 27
I'm not quite sure on what I would enter in the App Property. What would the declaration be if I don't know the name they enter? Would I make it, say, x, then have whatever they enter be replaced with x, then call on x when needed? If so how would I replace what they type with x?

_________________
Experience is the Teacher of all Knowledge ~ Julius Caesar


Top
 Profile  
Reply with quote  
 Post subject: Re: Remember Info
PostPosted: Sun May 10, 2009 2:46 pm 
Offline

Joined: Fri Sep 30, 2005 9:29 am
Posts: 732
Location: California
You make a property declaration....

App->Add Property

strUserName As String = "DefaultName"

When the user enters their name you do something like:

strUserName = UserNameField.Text 'UserNameField is an editfield

Then, whenever you need to use the username you reference strUserName


Top
 Profile  
Reply with quote  
 Post subject: Re: Remember Info
PostPosted: Sun May 10, 2009 9:02 pm 
Offline

Joined: Mon Aug 14, 2006 9:33 pm
Posts: 1774
When questions as basic as how to save a value to a variable crop up, I can't resist the urge to advise the OP to work through the tutorials and read a good book on RB in order to learn the basics. Trying to learn basic (or BASIC) programming by posting each question that occurs to this Forum can be a quite laborious and painful process.

Just my .02 FWIW

_________________
Roger Clary
Class One Software
Educational Software for Lifelong Learning
http://www.classonesoftware.com


Top
 Profile  
Reply with quote  
 Post subject: Re: Remember Info
PostPosted: Sun May 10, 2009 10:39 pm 
Offline

Joined: Sat Oct 01, 2005 12:01 pm
Posts: 65
Location: above sea level
i agree definitely work thru the tutorials

or at least pick some of the simple included example programs and just play around modifying them

not as good as the tutorials but more fun


Top
 Profile  
Reply with quote  
 Post subject: Re: Remember Info
PostPosted: Sun May 10, 2009 10:40 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
Dang... if you cannot grasp the concept of "named variables", there is no way you will ever be able to write even the simplest of programs, in this or any other language.

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Remember Info
PostPosted: Fri Jun 12, 2009 12:06 pm 
Offline
User avatar

Joined: Thu Mar 05, 2009 1:03 pm
Posts: 1786
Location: USA
DaveS wrote:
Dang... if you cannot grasp the concept of "named variables", there is no way you will ever be able to write even the simplest of programs, in this or any other language.

Well & accurately said, Dave. Frankoman, you've got to learn to use variables or you won't be able to program anything in ANY language. Try the RB Language Reference & Tutorials, play around with the example programs... try some simple hello world stuff... generally stay simple & fun until you get the hang of it, then go for the complex & serious stuff. :)

_________________
With great power comes great responsibility.
Learn something new every day, and the rest will take care of itself.
Life is a journey, not a destination. Enjoy the trip! :D


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group