Adding percents to variables?
Adding percents to variables?
(OP)
If you have an integer variable, how can you change the variable, so the number is a percentage?
Thanks
Thanks
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS Contact USThanks. We have received your request and will respond promptly. Come Join Us!Are you a
Computer / IT professional? Join Tek-Tips Forums!
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting Guidelines |
Adding percents to variables?
|
Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.
Here's Why Members Love Tek-Tips Forums:
Register now while it's still free!
Already a member? Close this window and log in.
RE: Adding percents to variables?
Kind of "We have variable X holding value 105; and we want..."
As for now I can't get what exactly you want to do.
RE: Adding percents to variables?
RE: Adding percents to variables?
dim n as integer
dim z as long
n = 50 'integer that you want to change
z = n 'you just put the integer into a
'percentage variable
im not sure if this example will work so dont trust me.
if im wrong about this then would somebody who nos better then me please tell me my mistake
RE: Adding percents to variables?
Remember, a huge part of programming is telling the computer how to do mundane things like display percentages, draw graphs or numbers, or add numbers together. You have to tell the computer everything, minus a couple things that the compiler handles for you. Since it seems this is probably for your game, could I again recommend playing around more with syntax and algorithms before tackling a full-scale RPG? Speaking from experience, I started a little higher than you seem to be when I stated coding the JRPG engine (http://djrpg.sourceforge.net), and the result has been years of problems that could have been solved by anyone of mediocre experience. Try setting up an action game to try various techniques on before you run full tilt into the single hardest genre to code, script, and otherwise create. You'll thank yourself later when you're coding away, hit a simple problem, and know the solution already from code you've already written. :)
RE: Adding percents to variables?
RE: Adding percents to variables?
I've noticed you came back four other times; but you didn't participate in your own post.
Have you found your answer?
- If not, you should respond to the above inquiries.
- If yes, you should post something here so that we all know this post is done.
Please let us know.--MiggyD
RE: Adding percents to variables?
Thanks.
Sorry.
RE: Adding percents to variables?