Skip to Content
It is currently February 26th, 2021, 10:58 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: April 18th, 2020, 7:45 pm 
Offline
New User
New User

Joined: April 18th, 2020, 7:36 pm
Posts: 1
Hello everyone!
I have a very little problem that is freaking me out... I'm writing a simple pal script in which i control the artist of the currently playing song.
If it is NOT equal to a particular artist, then the program should execute the if block (in which there is a waiting for a certain time), otherwise the execution should be paused waiting for the change of the artist.
What I obtain here is that the control of the current time is bypassed and the if block is repeated as a loop.

Code:
PAL.loop := true;   

var next, Song, liner,Jingle : TSongInfo;
var Aux                      : Tplayer;
var MyTime : DateTime;

Song := ActivePlayer.GetSongInfo;
Artista := Song['artist']; 

if Artista <> 'DIRETTA' then      //I control if the Artist is different from "DIRETTA"
Begin

PAL.WaitForTime('XX:59:35');        // wait the hour

[DO OTHER THINGS...]

end;


Any suggestions?


Top
 Profile  
Reply with quote  
PostPosted: April 19th, 2020, 8:09 am 
Offline
SVS Member
SVS Member

Joined: May 8th, 2004, 9:00 am
Posts: 10524
Location: Denver, CO
There is a limitation in PAL that it cannot wait inside an if..then loop UNLESS it is the last statement in the loop. Suggest using while..do instead.

_________________
- Rob Oyler, SVS
Image


Top
 Profile  
Reply with quote  
PostPosted: April 20th, 2020, 3:31 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8152
Location: Cologne (Germany)
DJ Cassio wrote:
UNLESS it is the last statement in the loop

That was new to me as well o.O

Other than that, I've got nothing to add.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 26 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® Forum Software © phpBB Group