|
- Forum - iziBasic
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257
Sujet n° 1301 |
Izibasic and file write - binary numbers |
le 26/11/2005 @ 23:50 par John_R
|
Wondering if there is a way to store numbers in a different format than string exponational (sp) format?
Or if its planned for a future versio?
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 1 -------- le 27/11/2005 @ 12:11 par aldweb
visiteur |
Sure there are ways to do it. String exponantial format is the one used by iziBasic for its purposes, but you are not obliged to stick to it.
The principle will then be to convert to the format you want in a string variable or in the MegaString (very adapted for byte purposes) and save this string variable or the MegaString. Then, to load back, read a string variable, and convert back if needed. Sorry, I don't feel I am very clear in my explanations...
Cheers
@+ aldweb |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 2 -------- le 27/11/2005 @ 23:23 par John_R
visiteur |
You are most clear :)
Thanks
I am so use to higher level language (Like Basic), that i do not understand why one can not save a number in binary. With out the conversion process.
Just curious.
John_R
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 3 -------- le 28/11/2005 @ 11:54 par aldweb
visiteur |
Hello John,
It was a decision, when I started iziBasic, to have it work with numbers in an easy way for users, so they would not have to bother if they are bytes, integers, long integers, reals...
So all numbers are single precision reals in iziBasic and iziBasic manages to work with these numbers in a transparent way.
If a number is an integer it is written in an integer format, encapsulated in a string. If it is a real number, it is saved in this exponential format, still put in a string.
Then, using iziBasic's read & write statements and functions, you may easily write a number and read it in a string variable, write a number in a string and read it in a number variable.
This is I believe very much in the "spirit" of the original Basic language.
I hope I answered your curiosity
Cheers, aldweb |
|
|
sujet actif
sujet clos
Important!
Nouveau message -
Rectifier message
Clôturer sujet
Remonter
|
|