Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently January 13th, 2025, 7:36 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Problems reading from variable and file
PostPosted: September 5th, 2005, 4:26 am 
Offline

Joined: March 26th, 2005, 4:01 am
Posts: 23
Hello, I am trying to create a very simple application that let people input text for a report and then read from this text in another page to generate the report.

I have created a publication variable called report_1. An input text has been created on page 1 that input the data into this variable report_1.
Since the entered text will dissapear when the application is closed I have to produced a button that save the input text into a txtfile called report_1.txt which is saved on a folder called "Reports"(write to disk file: Source: Report_1 variable; Filename: \Reports\Report_1.txt

In another page I created a text field that reads from "report_1.txt"

This should be easy but I have 2 problems:
1-it is not reading the file report_1.txt located in the folder called "Reports"

2-When publish it creates a 00000.txt

Any help will be appreciated. What Am I doing wrong?

cybernaut


Top
 Profile  
 
 Post subject:
PostPosted: September 5th, 2005, 8:29 am 
Offline

Joined: October 26th, 2004, 1:26 pm
Posts: 262
Quote:
It is not reading the file report_1.txt located in the folder called "Reports"


It is a always best to preceed the path with <SYSTEM_PUBLICATION_DIR>

e.g
<SYSTEM_PUBLICATION_DIR>\Reports\Report_1.txt

Quote:
When publish it creates a 0000000.txt


It seems to do that when using the "automatically read in text file..." -- that's a good question for DW. :wink:

Your best bet might be to read the file into a variable. See the attached (no script) IMP.

Hope this helps :)


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

_________________
Cheers,
Steve


Top
 Profile  
 
 Post subject: Great!
PostPosted: September 6th, 2005, 12:00 am 
Offline

Joined: March 26th, 2005, 4:01 am
Posts: 23
Hi Steve
Thank you very much for your help. I found what I was missing. One question: I can see you created an empty frame and add the actions to it. My question is this: can we add this to the page instead of an object or do you think it is better to an object.
Thanks again
Cybernaut


Top
 Profile  
 
 Post subject:
PostPosted: September 6th, 2005, 4:22 am 
Offline

Joined: October 26th, 2004, 1:26 pm
Posts: 262
Quote:
Can we add this to the page instead of an object or do you think it is better to an object?


Hi cybernaut,

It really will make no difference. I usually add an object to the page only for sake of "seeing" that I have done something for convenience.

Adding the On-Show trigger to the page will work the same. In some cases you can use a Pre-Show trigger on the Page, but I think in your case the typical On-Show will be appropriate. ;)

_________________
Cheers,
Steve


Top
 Profile  
 
 Post subject: Triggers & Action
PostPosted: September 6th, 2005, 4:56 pm 
Offline

Joined: October 25th, 2004, 2:20 pm
Posts: 686
Location: Naperville, Illinois (USA)
Opus: 7.05
OS: Win XP SP3
System: P4 3.2GHz 1GB RAM 2-TB HDs + 4 more
Steve's right that it doesn't matter (normally) whether you place an On Show Trigger on the Page, or on any Object.

Prior to using a Frame, which I name "Audio" or "Code", I'd put Triggers on Text Objects, and Image Objects. The only problem I then had was -- I couldn't find which Object had the Code. I'd have to use the Organizer, then select the "Action" tab to find which Objects had the "missing" Code. Sometimes I'd have multiple Triggers on multiple Objects. That made troubleshooting even more difficult.

Please learn from my mistakes. Standardize where you place your Triggers and Code, then it will be easier in the future to make corrections and changes. I'm recommending you create a Frame, which you name "Code" then use the Right Mouse click and change the View to Outline, so the Frame will display in a red outline. You can make the size of the Frame small enough to just show the word "Code", and place it in the upper left corner, out of the way. Use an "On Show" Trigger, then add your Action Code.

_________________
Fred Harms, Extraordinary Demos
Naperville, Illinois (USA) 630/904-3636
demofred@aol.com


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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