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 / DBP: Conversions

Author
Message
GoPostal
20
Years of Service
User Offline
Joined: 9th Sep 2004
Location:
Posted: 11th Oct 2004 06:54
How do I convert an integer to a string, I tried doing A$ = A.
Also, is it possible to write integers to files, it seems as though any other type can.
And finally, can you just use a "write array(x)" in conjunction with for...x and next x?
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 11th Oct 2004 08:03
conver integer to a string with
A = 10
B$ = str$(A)

convert string to integer with
B$ = "10"
A = val(B$)

GoPostal
20
Years of Service
User Offline
Joined: 9th Sep 2004
Location:
Posted: 15th Oct 2004 02:23
OK, but will this work (because it hasn't)
For x = 0 to 81
B$(x) = A$(x)
next x
.....
For x = 0 to 81
write B$, 1, "Myfile.inf"
next x

??
Mr Underhill
21
Years of Service
User Offline
Joined: 23rd Apr 2003
Location: The Forgotten Worlds...
Posted: 15th Oct 2004 03:00
Quote: "write B$, 1, "Myfile.inf""

I haven't done file-writing in DBP yet, but I think this is wrong. You have to open to write a file and write to it with only the string and file number (not filename).

“Do you wish me a good morning, or mean that it is a good morning whether I want it or not; or that you feel good this morning; or that it is a morning to be good on?” -Gandalf
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 15th Oct 2004 11:07 Edited at: 15th Oct 2004 11:16

writes them to file and this will get them back.


Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 15th Oct 2004 11:57
There are more methods to do this as well. You can write the values directy to the file.

Or you can save the array to the file


There are probably other ways as well. There is always more than one way to do anything

GoPostal
20
Years of Service
User Offline
Joined: 9th Sep 2004
Location:
Posted: 15th Oct 2004 16:40
Thank you very much, hopefully I can get this working.

Login to post a reply

Server time is: 2024-09-23 02:37:22
Your offset time is: 2024-09-23 02:37:22