Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > GUI Development
  New Posts New Posts RSS Feed - Reading and writing a local drive
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum LockedReading and writing a local drive

 Post Reply Post Reply
Author
Message
acmedia View Drop Down
Senior Member
Senior Member


Joined: April 26 2005
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote acmedia Quote  Post ReplyReply Direct Link To This Post Topic: Reading and writing a local drive
    Posted: April 27 2006 at 9:05am
For the life of me I can't see how this would be done - there must be something very obvious I'm missing.

All I want to do is read a file (with ATGUIOPENDIALOG?), manipulate the data, then save it (with ATGUISAVEDIALOG?). This would be all Windows based and wouldn't be using any MultiValue data.
Back to Top
Deech View Drop Down
Moderator Group
Moderator Group

Moderator -- GUI Development

Joined: December 15 2003
Status: Offline
Points: 177
Post Options Post Options   Thanks (0) Thanks(0)   Quote Deech Quote  Post ReplyReply Direct Link To This Post Posted: April 27 2006 at 9:13am
Acmedia,

ATGUIOPENDIALOG is only for getting the location or file name of a file on the client machine. This isually a file that you are going to write to from the host, or transfer the data from the file to the host. It is not meant to provide client read/write access from Pick BASIC.

If you want to manipulate the data in Pick you will have to transfer it to the Pick Host with some transfer scripting, write code to do your manipulations and place the results into an array or PICK host file and then write the script to transfer that array or file back to the client PC.

Unless you just want to rename the file or do some super simple client side manipulations then you need to write a script to transfer a batch file to do your copy or renaming or other client side processing.

I guess it would be easier to answer your questions if you would please provide more details in what you are trying to accomplish.

Hope this helps,

Deech
Accuterm GUI--Changing the Face of MV Development!!
Back to Top
acmedia View Drop Down
Senior Member
Senior Member


Joined: April 26 2005
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote acmedia Quote  Post ReplyReply Direct Link To This Post Posted: April 27 2006 at 9:20am
There's no project waiting for this part at the moment, but it's something I can't see how to do - the mentions of ATGUIOPENDIALOG and ATGUISAVEDIALOG were because that was the only thing I could find.

Let's take a basic example. The user wants to select a text file on their C drive, have it displayed in an editable text box, edit it, then save it back to their C drive, possibly in a different location or with a different name.

How would that be done?

Back to Top
Deech View Drop Down
Moderator Group
Moderator Group

Moderator -- GUI Development

Joined: December 15 2003
Status: Offline
Points: 177
Post Options Post Options   Thanks (0) Thanks(0)   Quote Deech Quote  Post ReplyReply Direct Link To This Post Posted: April 27 2006 at 9:36am
Acmedia,

Okay here's broad outline, I will post some code when I get a chance.

1.) Use ATGUIOPENDIALOG to get the name of the file you want to put into the text window.

2.) Write an execute statement to run FT with the appropriate parameters including the name of the file you got using the ATGUIOPENDIALOG command. Transfer the item to some kind of scratch file on the PICK host.

3.) Read the item from the scratch file into the PICK program and place its data into the multi-line edit control.

4.) User clicks the save button, GUI program writes the changes back to the scratch file and then pops up the ATGUISAVEDIALOG and gets the file name from the user.

5.) Using an EXECUTE statement with the file name from the user you again use accuterm FT to transfer the modified host item back to the client machine.

Done. Please consult the help files or the File Transfer forum for more specific help on scripting FT.

Hope this helps,

Deech
Accuterm GUI--Changing the Face of MV Development!!
Back to Top
acmedia View Drop Down
Senior Member
Senior Member


Joined: April 26 2005
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote acmedia Quote  Post ReplyReply Direct Link To This Post Posted: April 27 2006 at 10:00am
Thanks - when you said "transfer scripting" I had a look through the manual, and with your last post I can see how to do it that way.

I was hoping (expecting?) that AccuTerm would be able to do more with local files, but it's understandable that it concentrates on the MV side.
Back to Top
Deech View Drop Down
Moderator Group
Moderator Group

Moderator -- GUI Development

Joined: December 15 2003
Status: Offline
Points: 177
Post Options Post Options   Thanks (0) Thanks(0)   Quote Deech Quote  Post ReplyReply Direct Link To This Post Posted: April 27 2006 at 12:12pm
Acmedia,

Now come to think of it, there maybe a way to work with the Accuterm Client-side VBA scripting language that can do this a bit more effeciently, without having to use FT to tranfer the file to the host.

This would require knowing a bit about the Accuterm VBA Scripting language and being able to "Pick up" variables from that environment to a program running on the MV host. This is basically how the AT GUI environment works.

Actually, now that I look at what I wrote, it's probably not a bad idea to investigate that and give it a try. But that would be slightly off topic for this forum and probably better asked and answered in the Scripting & Automation forum.
Accuterm GUI--Changing the Face of MV Development!!
Back to Top
LiveBlues View Drop Down
Groupie
Groupie


Joined: February 28 2005
Status: Offline
Points: 93
Post Options Post Options   Thanks (0) Thanks(0)   Quote LiveBlues Quote  Post ReplyReply Direct Link To This Post Posted: May 02 2006 at 3:02am
Some multivalue databases have the ability to do this. For example, in QM, you can do this with openseq, readseq and writeseq. I would only try this on straight text files though.

Here is a small example of what I am talking about

I have a small text file in C:\downloads\test.txt that contains the following lines:


This is a test
It is testing the openseq
and readseq
and writeseq
functions
of QM

Then I have the following program:

0001: *
0002: OPENSEQ 'C:\DOWNLOADS\test.txt' TO TEST.FL ELSE STOP
0003: *
0004: 10 *
0005: READSEQ LN FROM TEST.FL ELSE STOP
0006: PRINT LN
0007: GO 10


This is the output of the program:

:RUN BP TEST.SEQ
This is a test
It is testing the openseq
and readseq
and writeseq
functions
of QM


I didn't actually make any changes or write the file back out, but I think you can see where I was going.

D3 has this ability as well, but I have never played around with it.


Back to Top
LiveBlues View Drop Down
Groupie
Groupie


Joined: February 28 2005
Status: Offline
Points: 93
Post Options Post Options   Thanks (0) Thanks(0)   Quote LiveBlues Quote  Post ReplyReply Direct Link To This Post Posted: May 02 2006 at 3:10am
I should have added that to write the file back out you would use the closeseq function.
Back to Top
acmedia View Drop Down
Senior Member
Senior Member


Joined: April 26 2005
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote acmedia Quote  Post ReplyReply Direct Link To This Post Posted: May 02 2006 at 5:31am
So it looks like writing an mp3 tag editor in UniVerse is going to be a tricky thing :)
Back to Top
LiveBlues View Drop Down
Groupie
Groupie


Joined: February 28 2005
Status: Offline
Points: 93
Post Options Post Options   Thanks (0) Thanks(0)   Quote LiveBlues Quote  Post ReplyReply Direct Link To This Post Posted: May 02 2006 at 6:05am
Originally posted by acmedia acmedia wrote:

So it looks like writing an mp3 tag editor in UniVerse is going to be a tricky thing :)


Universe probably has the same functionality as QM in that respect. Are the tag files text only?
Back to Top
LiveBlues View Drop Down
Groupie
Groupie


Joined: February 28 2005
Status: Offline
Points: 93
Post Options Post Options   Thanks (0) Thanks(0)   Quote LiveBlues Quote  Post ReplyReply Direct Link To This Post Posted: May 02 2006 at 7:17am
Since I figured that I just showed my ignorance with my last question, I did a little research into mp3 tags. Since you will know the location of the information and it is fixed length, you might be able to pull this one off. I had an mp3 laying around, so I modified my program to read it and display the last line of the file which did show me the song title and band name. I can't remember what I used to rip that mp3, but it obviously is using the original format since it was at the end of the file. I bet with a little playing around, you could extract the data you want. Re-inserting it might be the tricky part.
Back to Top
acmedia View Drop Down
Senior Member
Senior Member


Joined: April 26 2005
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote acmedia Quote  Post ReplyReply Direct Link To This Post Posted: May 02 2006 at 7:33am
We're getting away from AccuTerm here but for the curious:

ID3v1 holds the data in 128 bytes at the end of a file, and starts with "TAG". One field uses a byte value, the rest are ASCII

ID3v1.1 is a slight alteration, it's the same size but one of the fields is reduced by a character to allow for another byte field.

But then came ID3v2 (.2, .3, .4) and everything changed - it's not fixed length, it's at the start of the file, and it can include all forms of data. A guide to the ID3 tag is at http://www.id3.org/

Probably using VB to read the tags, then dumping a flat file into the MV environment for processing would be the way to go.
Back to Top
Deech View Drop Down
Moderator Group
Moderator Group

Moderator -- GUI Development

Joined: December 15 2003
Status: Offline
Points: 177
Post Options Post Options   Thanks (0) Thanks(0)   Quote Deech Quote  Post ReplyReply Direct Link To This Post Posted: May 02 2006 at 8:37am
Acmedia,

Sorry to hear you are moving away from Accuterm. I think LiveBlues is right and from my experience with U2 I also agree with him that it should have openseq writeseq fuctions. That way you can at least read/write files on the server all you have to do is transfer them there.

Slightly OFF topic:

Are you moving off MV platform or just moving away from Accuterm to another Competing terminal application?

Just Curious / Hope this helps,

Deech
Accuterm GUI--Changing the Face of MV Development!!
Back to Top
LiveBlues View Drop Down
Groupie
Groupie


Joined: February 28 2005
Status: Offline
Points: 93
Post Options Post Options   Thanks (0) Thanks(0)   Quote LiveBlues Quote  Post ReplyReply Direct Link To This Post Posted: May 02 2006 at 9:51am
Deech,

I think that Acmedia meant that we were moving the topic away from Accuterm and more towards mp3 tags.
Back to Top
Deech View Drop Down
Moderator Group
Moderator Group

Moderator -- GUI Development

Joined: December 15 2003
Status: Offline
Points: 177
Post Options Post Options   Thanks (0) Thanks(0)   Quote Deech Quote  Post ReplyReply Direct Link To This Post Posted: May 02 2006 at 9:54am
Live Blues,

Yep, Okay, duh. You're right. I'll read more carefully. But knowing what he was trying to do with it was definately helpful.

Sorry all,

Deech
Accuterm GUI--Changing the Face of MV Development!!
Back to Top
acmedia View Drop Down
Senior Member
Senior Member


Joined: April 26 2005
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote acmedia Quote  Post ReplyReply Direct Link To This Post Posted: May 03 2006 at 5:10am
Yes, it's the thread that's going away from AccuTerm, not the company - and the mp3 tags was a top of the head example about files that aren't text [though now that I've thought of it I like the idea of setting up a mv database for them].
Back to Top
homerlh View Drop Down
Beta Tester
Beta Tester


Joined: November 11 2004
Location: United States
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote homerlh Quote  Post ReplyReply Direct Link To This Post Posted: May 03 2006 at 6:54am
Greetings,

Way up in this topic, LiveBlues gave an example of QM reading and writing from a DOS (Windows) text file. I don't think the program will work as he's written it to write data onto the client computer. It WILL work with data that is on the same computer that QM is running on, but not on some arbitrary client computer.

I support a client whose package uses this technique a lot under D3, so I know it works there. However, it only works on drives physically attached to the D3 server, or those that have been carefully mapped to the computer. I also use the mapping to upload the status of faxes that were sent on a separate fax server.

Larry Hazel
Back to Top
LiveBlues View Drop Down
Groupie
Groupie


Joined: February 28 2005
Status: Offline
Points: 93
Post Options Post Options   Thanks (0) Thanks(0)   Quote LiveBlues Quote  Post ReplyReply Direct Link To This Post Posted: May 03 2006 at 1:46pm
Thanks for pointing that out Larry. I hadn't really thought of that when making my example. In my case, the database resides on the computer that I usually work on.
Back to Top
homerlh View Drop Down
Beta Tester
Beta Tester


Joined: November 11 2004
Location: United States
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote homerlh Quote  Post ReplyReply Direct Link To This Post Posted: May 03 2006 at 3:51pm
Hey Live,

You are welcome.

Larry
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.