File handling question

Previous topic - Next topic

Gary

Quote from: Kitty Hello on 2010-Jan-14
For writing to iPhone, you must use the directory: PLATFORMINFO$("DOCUMENTS"), though. The rest is read only.

So with my example would I need to have the file name as something like
INIOPEN PLATFORMINFO$("DOCUMENTS")+"numberofruns.ini"
or do I need a / before the ini file name?

FutureCow

The quickest way to find out would be to write a program that does
debug PLATFORMINFO$("DOCUMENTS")+"\n"
and see what it displays, then add a "/" if necessary.

Gary

I did it the obvious way

Code (glbasic) Select
SETCURRENTDIR(PLATFORMINFO$("DOCUMENTS"))
INIOPEN "numberofruns.ini"



FutureCow

Under windows it should be wherever your current profile's "My Documents" folder is (Usually either C:\My Documents\[username] , or just C:\My Documents)

Sokurah

Hmm, I think I need some help...or a kick in the head.  :giveup:

I can't seem to make this work;

Code (glbasic) Select
GLOBAL FILE_PATH$ = PLATFORMINFO$("DOCUMENTS")

I just can't make it return a usable document folder path (I'm on Window XP).
If I print FILE_PATH$ it gives me 'NO_DATA'.

Am I doing something wrong?
Website: Tardis remakes / Mostly remakes of Arcade and ZX Spectrum games. All freeware. :-)
Twitter: Sokurah

FutureCow

#20
GLBasic has problems assigning values to global variables at the same time you create them - i.e.
Code (glbasic) Select
Global [var] = [value]

First thing to try is separating the creation from the assignment
Code (glbasic) Select
GLOBAL FILE_PATH$
FILE_PATH$ = PLATFORMINFO$("DOCUMENTS")


Other than that I can't be of much help as a test of those two lines gives me the correct result in a Windows test program and I don't have an iPhone.

Sokurah

Crazy. I just tried here at work and it works perfectly on Windows 7.
But at home, on Windows XP, it doesn't. Strange.  :doubt:
Website: Tardis remakes / Mostly remakes of Arcade and ZX Spectrum games. All freeware. :-)
Twitter: Sokurah

FutureCow

I tested on v7.242 on windows XP which worked.

MrTAToad

MD5, AES and SHA-512 routines are available in the Maths section, if I remember correctly.