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 / Excessive string checking

Author
Message
Alkaline
20
Years of Service
User Offline
Joined: 4th Dec 2003
Location: Seattle, Washington
Posted: 26th Jul 2006 00:47
Well first off I didn't know how to title this post

Well moving on here is my code



Ok what i have is a interger which is read from a file (conf_programnumber#) I want this varible to be able to change to what ever number with out limiting it in the coding Like I have done above. I limited it to only a max of 6. well anywho What I am trying to do be able to change the number in the string conf_program6$, the number from 1 up to the conf_programnumber# is.

here is my first attempt which all I got from errors. Maybe it will help you understand what i am trying to do.



well I don't know how much to explain it so if you have questions then please post.

1.5 GIG DDR pc3200||ATI 9600xt 256mb||330 GB hard drive||Amd XP 3000+
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 26th Jul 2006 01:16 Edited at: 26th Jul 2006 01:19
I do not entirely understand what you are asking, but I have a few things...

In your first posted code
Try this:


Sorry for the messy spacing.

In your first attempt
1. The VAL(String) command does not work with real numbers, it works with strings, that's why it says STRING.

If you want to convert your real number into a string, use the STR$(Value,deciamal places) command. The "decimal places" is the number of deciaml places in the variable that you are trying to translate.

If you want to convert a real number into an integer, just write something like INTEGER=REAL# that simple.

Oh, and you cannot change variables within your code with more code. Like this will not change the add-on of a variable.


You could try an array, however. That's all I can say now I have to go someplace.

QuothTheRaven
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 26th Jul 2006 01:34
Whatever you're trying to do makes absolutely no sense at all and I can't understand it, but try looking into arrays like sixty suggested. Are you trying to make variable names the value of the variable?

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 26th Jul 2006 11:16 Edited at: 26th Jul 2006 11:16
sounds like you need an array. Post more code and we could help you structure it better, I'm just taking a shot in the dark here.



"Using Unix is the computing equivalent of listening only to music by David Cassidy" - Rob Pike

Login to post a reply

Server time is: 2024-11-27 12:32:19
Your offset time is: 2024-11-27 12:32:19