Digital Workshop

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Read next lines
PostPosted: December 27th, 2017, 8:03 am 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
Hello,

For a show jumping competition i want to make a screen that helps the riders to see who's riding at the moment,
and to show them when it's their turn. With this system they know how much time they have left to prepare for their round.
The list with Current and Next riders will be displayed on a second screen. The Ring Master operates the "menu"screen.

It is a simple but effective solution and it is almost finished, but I do not know how to display the "next" riders from the list.
Another thing i can't figure out is how to go lines back. Now i can go to the next line and to the first line but not one or two lines back.
That would be very nice and make this application complete.

I have attached the .imp file and an example list to this post.
Kind Regards, Ad Mulders

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Last edited by Ad Mulders on January 10th, 2018, 7:30 am, edited 1 time in total.

Top
 Profile Visit website  
 
 Post subject: Re: Read next lines
PostPosted: January 4th, 2018, 12:22 pm 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
Happy new Year to all Opus Pro Users!!

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Read next lines
PostPosted: January 5th, 2018, 10:09 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Cheers Ad and seasons greetings from the UK.

As for the question, you'd be better using scripting than actions. I'd read all the contents into an Array and simply navigate that.

</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


For this message mackavi has been thanked by : Ad Mulders


Top
 Profile Visit website  
 
 Post subject: Re: Read next lines
PostPosted: January 5th, 2018, 1:15 pm 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
Thans Mack,
Hope You can hellp me

Kind Regards, Ad

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Read next lines
PostPosted: January 8th, 2018, 11:47 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Here's a working example for you and anybody looking to read from a file or navigate arrays.


download from: http://www.live.interaktiv.co.uk/?section=files

using code: readfile@digitalgrapevine.info

The core code included in the example is:

Code:
function readFile(){

myFileArray = new Array() // you also need this as a publication or page variable to display data on screen.
myIndex = 0;

//location of your file
var tmpFile = SYSTEM_PUBLICATION_DIR + "Test_list.csv";

//open the file above for reading
var tmpFileObject = OpenFile(tmpFile);

//index for array above
var tmpIndex = 0;


//loop to read through all lines in file
while (tmpFileObject.EndOfFile() == false)
   {
   //read each line into the array and increment the index
   myFileArray[tmpIndex] = tmpFileObject.ReadLine();
   tmpIndex++;
   }
   
//adjust for extra line read.   
myFileArray.length = myFileArray.length - 1
}



</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Read next lines
PostPosted: January 8th, 2018, 12:02 pm 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
Thanks Mack.

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Read next lines
PostPosted: January 10th, 2018, 7:28 am 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
:oops: Hello Mack.
After a few hours of trail and error I have to give it up. I am unable to process your script in my program so that I can show the next 3 participants in the "Next" list. The program is actually finished on the Next rider function. How do I process your script so that it works. Hope you want to help me.

Kind Regards, Ad Mulders

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Read next lines
PostPosted: January 12th, 2018, 10:14 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Accessing other items in the array is simply a case of specifying the index value.

Here's a modified example that shows that.

code for download: readfile-v2@digitalgrapevine.info

</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


For this message mackavi has been thanked by : Ad Mulders


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 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