Kevin, The original code asked for a device, i.e. a lookup value in the DEVICE file, such as "HFS". The prompt for file comes later, provided the ASK HOST FILE field is valued YES. Doesn't $$FTG followed by a loop to $$STRIP the data in effect traverse the data twice, as opposed to once in the original code?

Lloyd

----- Original Message ----- From: "Kevin Toppenberg" <[EMAIL PROTECTED]>
To: <hardhats-members@lists.sourceforge.net>
Sent: Wednesday, February 16, 2005 1:14 AM
Subject: Re: [Hardhats-members] Using ^%ZIS to select input file



Well, its 1am, and I'm up way too late...

I decided that I entirely didn't like the way the HFS
upload was being done in this function, so I have
rewritten it.  It now uses $$FTG^%ZISH to load the HFS
file, rather than opening an IO channel through a
device, and then reading the file in line by line.

Here is the code if anyone is interested.:

Here is the change to TIUUPLD.m
========================================
HFS(DA) ; Read HFS file
;"----------------------  //kt
       ;"K. Toppenberg Modification
do LoadTIUBuf^TMGMISC(DA)
     quit

========================================
Here is LoadTIUBuf^TMGMISC

LoadTIUBuf(DA)
;"Purpose: to ask user for filename, and then load
this into a
       ;" TIU buffer (that already has been created)
       ;"Input: DA : the IEN (record number) in file
^TIU(8925.2), i.e.
       ;" in file TIU UPLOAD BUFFER, that the file
is
       ;" to be loaded into.
       ;"Results: none

if '$data(TIUPRM0)!'$data(TIUPRM1) do SETPARM^TIULE
write @IOF
       do JUSTIFY^TIUU($$TITLE^TIUU("ASCII
UPLOAD"),"C")

       new FPName
       new result set result=0
       set FPName=$$GetFName^TMGIOUTL("Enter name of
file containing transcription","/tmp/")
if FPName'="" do
       . new name,path,BuffP
       . do
SplitFNamePath^TMGIOUTL(FPName,.path,.name)
       . if ($get(path)="")!($get(name)="") quit
       . set BuffP="^TIU(8925.2,"_DA_",""TEXT"",1,0)"
. if $$FTG^%ZISH(path,name,BuffP,4) do
       . . set result=1
       . . new MaxLine set
MaxLine=$order(^TIU(8925.2,DA,"TEXT",""),-1)
       . . set
^TIU(8925.2,DA,"TEXT",0)="^^"_+MaxLine_"^"_+MaxLine_"^"_DT_"^^^^"
       . . new index set
index=$order(^TIU(8925.2,DA,"TEXT",0))
       . . for  do  quit:index=""
       . . . if index="" quit
       . . . new s set
s=$$STRIP^TIUUPLD(^TIU(8925.2,DA,"TEXT",index,0))
       . . . set ^TIU(8925.2,DA,"TEXT",index,0)=s
       . . . set
index=$order(^TIU(8925.2,DA,"TEXT",index))

       if result=0 do
       . write "Unsuccessful upload.",!
quit
========================================

I reference a few extra functions I can get anyone
that wants them.

Kevin




--- Kevin Toppenberg <[EMAIL PROTECTED]> wrote:

I'm having a hard time with my transcription upload
system.  At first the KERMIT upload system built
into
the TIU system would work after 1-4 tries.  But
today
it's absolutely refusing to upload a text file.

So I have tried to use the other built-in system:
HFS.

This is a screen log of what I see when I try this
method:
------------------------
                     A S C I I   U P L O A D

Select Host File:

DEVICE: HOME// /tmp/thwing2-11-2005.txt  [DEVICE
DOES
NOT EXIST]
DEVICE: HOME//

------------------------

Here is the relevant portion of the code (TIUUPLD.m)

HFS(DA) ; Read HFS file
N TIUI,X
I '$D(TIUPRM0)!'$D(TIUPRM1) D SETPARM^TIULE
W @IOF D JUSTIFY^TIUU($$TITLE^TIUU("ASCII
UPLOAD"),"C")
W !!,"Select Host File:",! D ^%ZIS I POP W
!,$C(7),"Device unavailable." Q
F  U IO R X:DTIME Q:'$T!(X=EOM)!(X="^")!(X="^^")  D
. U IO(0) W X,!
. S

TIUI=+$G(TIUI)+1,^TIU(8925.2,DA,"TEXT",TIUI,0)=$$STRIP(X)
S

^TIU(8925.2,DA,"TEXT",0)="^^"_$G(TIUI)_"^"_$G(TIUI)_"^"_DT_"^^^^"
D ^%ZISC
Q

------------------------

So it looks like it is using ^%ZIS to open the HFS
file.  But for some reason, its not working.  It
seems
to me that ^%ZIS is looking for an OUTPUT file.
Asking for help gives me info about setting margins
etc (i.e. for an output printer.)

Any ideas about what I am doing wrong here?

Thanks
Kevin


__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT
Products from real users.
Discover which products truly live up to the hype.
Start reading now.

http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Hardhats-members mailing list
Hardhats-members@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/hardhats-members





__________________________________
Do you Yahoo!?
Meet the all-new My Yahoo! - Try it today!
http://my.yahoo.com




------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Hardhats-members mailing list Hardhats-members@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hardhats-members




------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Hardhats-members mailing list Hardhats-members@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hardhats-members

Reply via email to