Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Variable not dividing...What's wrong?

Author
Message
RoyalBlood
15
Years of Service
User Offline
Joined: 8th Apr 2009
Location: Stuck in this box!
Posted: 28th May 2009 02:45

When I run it, it's not dividing...CenterX is just showing up as the width of WordsX.

AMPConcepts.webs.com
Erk
16
Years of Service
User Offline
Joined: 26th Feb 2008
Location:
Posted: 28th May 2009 03:01
If it carries over from other languages, the problem is that you can't divide integers.
If you call it centerx# and divide by 2.0 then it should work
RoyalBlood
15
Years of Service
User Offline
Joined: 8th Apr 2009
Location: Stuck in this box!
Posted: 28th May 2009 03:35
Still didn't work...

AMPConcepts.webs.com
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 28th May 2009 03:44
No, that wouldn't cause this, it would just be rounded...

Try to simplify the program as much as possible temporarily to track down the error. wordsx$ might not be storing what you think it is. The text settings might not be what you think they are. Most likely it's in the way you are using the value that the error is occuring.

Also you might try putting parenthesis around the text width(wordsx$).



Diggsey: I have a spine and memory, but one memorable guy says he hates me. What am I?
Vathelokai
15
Years of Service
User Offline
Joined: 3rd May 2009
Location:
Posted: 28th May 2009 04:59
It looks like you are trying to divide text by two. I think (all guess work) that you should try something like...



The dollar sign is telling the program that it is a word and not a number (even if the word is made up of number characters), so it cannot be part of normal math.
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 28th May 2009 16:21
@Vathelokai

Text Width is an integer, the string is just a parameter for it. I see no reason why the code originally posted shouldn't work.

Also, you're missing a rather important hash sign in your code...





Diggsey: I have a spine and memory, but one memorable guy says he hates me. What am I?
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 28th May 2009 17:26
this just works for me!



*ding ding*
Dabbler
17
Years of Service
User Offline
Joined: 3rd Mar 2007
Location: Minnesota
Posted: 29th May 2009 05:02
Is this of any help?



I hope so.


Whatever...

Login to post a reply

Server time is: 2024-11-24 06:56:31
Your offset time is: 2024-11-24 06:56:31