Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 11:45 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Scripting: Writing new lines to text file
PostPosted: April 16th, 2007, 3:31 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi

I'm stuck in a project creating a script to store info in a single text file.
I tried the DB route using Access and am finding the DB feature a bit "buggy" (for example, the tick mark for one of the variables, "ID," in the SQL wizard keeps evaporating and the update record fails, repeatedly.) So far, the DB route hasn't worked.

So, the best route would be to use a .txt file, storing data strings line by line. The pub design is a form with text input boxes connected to variables, collecting the same data for up to 50 people. So, the data categories are the same. The optimal script design would be

If uniqueID = "1" then write string (values stored in variables like name, age, job, etc.) to first line of text file
If uniqueID = "2", write values for same string of variables (some could be left blank, however) to the next line, and so forth.

Then the single (encrypted) text file can be sent to another person for their input, completion, necessitating that they have a copy of the pub with same encryption key, to open it and read back the data already stored in the text file: to re-populate the form page in their pub to view each person's data represented by uniqueID = "1", and so forth.

So far, any sample script I've come up with has failed. Can't seem to get it to write or read back. I'll attach a sample .imp, if anyone could take a look and suggest a way to make it work.

Any help would be appreciated.

Kind Regards,


You do not have the required permissions to view the files attached to this post.

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: April 16th, 2007, 5:09 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Stephen,

Sorry to hear the DB idea was turning out to be 'buggy'. It's not the easiest way to store data from Opus, but that's DBs in general.

I'll download your ilm asap but for now three things,

When you Open your file, set the overwrite false, this will automatically append the next piece of information to the end of the file.

As for your blanks, I would write a NULL value to the file.

As for the one string for each person, I've opted for storing each variable on a new line in the file. Because I know that I'm storing 30 variables, I can read them back in loop. It's made debug the process easier.

Mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: April 16th, 2007, 5:17 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Thanks, Mack for your suggestions.

Too bad about the Access DB path. It seemed promising, but still has some bugs to work out (like disappearing ticks). Hope the V6 release improves this potentially super feature.

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: April 16th, 2007, 5:30 pm 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
Stephen,
Really sorry to hear you are having so many problems with your Access implementation. For me, it is one area which just works so reliably in any database application I have created. But that's computers!!!
Is the ID the primary key created by the access database, in which case I'm not sure you will be able to change it via Opus. incase you duplicate a primary key or leave it blank, which would screw up the database??

_________________
Whoever designed this, never actually used it!


For this message sandyn has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: April 16th, 2007, 6:21 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi Sandy

Thanks for your reply.

It is the primary ID assigned in Access with auto feature to add an ID when a new row is added.

I've tried to both not check and check this. No matter: I can't get it to update. When checked and re-opened, it has been spontaneously unchecked and the line is grayed out, so it can't accept a new check. However, as mentioned, even without this checked, no updating occurs. I'm stumped. I'd post the sample, but as you know with these DB's, the OCBD and SQL wizard steps have to be established new for the .imp. And it seems the difficulty lies within these.

Any ideas are appreciated. I thought the Access option holds promise, but it does need to update.

Any single text file storage alternate solution would also have to be capable of finding the right storage line to match the unique ID of the person whose data has been stored, so that it can be updated, changed, deleted, completed. Plus encrypted.

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: April 16th, 2007, 6:34 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Stephen,

Included is a quick example of write / read to text file.

Load page one, enter data, click write button - repeat a couple of times.
Load Page two, click read button to cycle through written data.

Have a play and then let me know.

Mackavi


You do not have the required permissions to view the files attached to this post.


Top
 Profile Visit website  
 
 Post subject:
PostPosted: April 16th, 2007, 7:50 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Thanks, Mack.

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Maybe this is something...
PostPosted: April 16th, 2007, 8:21 pm 
Offline

Joined: December 14th, 2004, 5:08 pm
Posts: 55
Location: Holland
Opus: version 8.0
OS: XP, Vista, Windows7, Windows8
System: Intel Corei7-2600 CPU 3.400GHz
I had made a few databases with Opus and I found a sample which I implemented in your pub , have a look and maybe it will help solving the above issues...


You do not have the required permissions to view the files attached to this post.


For this message ivisionar has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: April 16th, 2007, 8:27 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Thanks Jim.

I'll have a look.

I am certainly learning alot: "crash course" in DB's.

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 35 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group