save data to PC
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
save data to PC
Several years ago made program in RunTime 2.8.1 on a Mac. Made standalone for Mac and PC. Worked well, and saved collected responses to
a data folder on the computer, both Mac and PC. Have since downloaded community Livecode and also upgraded the Mac operating system. Opened the program in Livecode, made some minor changes - nothing to do with writing the responses to the data file, and again made standalones. Runs well on Mac and PC but doesn't save the responses to the PC. Any solutions?
a data folder on the computer, both Mac and PC. Have since downloaded community Livecode and also upgraded the Mac operating system. Opened the program in Livecode, made some minor changes - nothing to do with writing the responses to the data file, and again made standalones. Runs well on Mac and PC but doesn't save the responses to the PC. Any solutions?
Re: save data to PC
I think the file structure change that happened several versions ago may be the culprit. Someone will come in soon and tell you.
Craig Newman
Craig Newman
Re: save data to PC
Hi sharyn,
1. welcome to the forum!
2. we MIGHT need to take a look at your script(s) to answer this
Best
Klaus
1. welcome to the forum!

2. we MIGHT need to take a look at your script(s) to answer this

Best
Klaus
Re: save data to PC
Hi,
Data path set up as follows:
set the itemdel to "/"
get the filename of this stack
delete the last item of it
put it into OPath
put OPATH & "/data/" into DPATH
.....
data written to computer:
put fld "Finishdata" on card "Bio" into URL ("file:" & DPATH & APPLICANT & TAB & OMSASN & "data.xls")
Any help greatly appreciated. I'm a research assistant, not a programmer, so assume I know very little.
Data path set up as follows:
set the itemdel to "/"
get the filename of this stack
delete the last item of it
put it into OPath
put OPATH & "/data/" into DPATH
.....
data written to computer:
put fld "Finishdata" on card "Bio" into URL ("file:" & DPATH & APPLICANT & TAB & OMSASN & "data.xls")
Any help greatly appreciated. I'm a research assistant, not a programmer, so assume I know very little.
Re: save data to PC
Hi sharyn,
AHA!
OK, the problem is, that the user of your standalone does not have WRITE permission in the application folder!
Same for Windows!
So better change your scripts to read/write from/to the users DOCUMENTS folder!
Best
Klaus
AHA!

OK, the problem is, that the user of your standalone does not have WRITE permission in the application folder!
Same for Windows!
So better change your scripts to read/write from/to the users DOCUMENTS folder!
Code: Select all
...
put specialfolderpath("documents") & "/data/" into tPath
## Check if folder already exists, if not create it!
if there is not a folder tPath then
create folder tPath
end if
.....
## I presume that APPLICANT and OMSASN are variables?
## If they are just "names" you should put QUOTES around them
## Hint 1:
## A TAB in a filename as not really a good idea, so I replace it with an UNDERSCORE in the example.
put fld "Finishdata" OF card "Bio" into URL ("file:" & tPath & APPLICANT & "_" & OMSASN & "data.xls")
## Hint 2: adding the suffix XLS to a simple textfile does not make it a valid EXCEL document.
## But since I do not use Office, this might work anyway :-)
...
Klaus
Re: save data to PC
Hi,
The code as I've written worked well on Mac and PC (Windows). Still works on the Mac, but not the PC, so I think there must be something other than what you've suggested. I'll give it a try, though. Thanks.
The code as I've written worked well on Mac and PC (Windows). Still works on the Mac, but not the PC, so I think there must be something other than what you've suggested. I'll give it a try, though. Thanks.
Re: save data to PC
Sorry, I should have written:
...
the user of your standalone MAY not have WRITE permission in the application folder!
...
And with specialfolderpath("documents") you are always safe
...
the user of your standalone MAY not have WRITE permission in the application folder!
...
And with specialfolderpath("documents") you are always safe
