Skip to Content
It is currently November 12th, 2019, 5:00 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: November 8th, 2019, 6:02 am 
Offline
Senior User
Senior User

Joined: September 7th, 2018, 9:00 am
Posts: 108
I very simplified my code here below to explain what is happening (my real code is way more complex)

The statement PAL.WaitForTime is always ignored if and only if there is the "IF" block.
is there a way to make it working and/or to have this bug solved in a next release please?

Code:
var test : float = 10;

IF test = 10 THEN
BEGIN
  PAL.WaitForTime('+00:00:10');
  writeLn('END');
END;


Top
 Profile  
Reply with quote  
PostPosted: November 8th, 2019, 7:06 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7880
Location: Aachen (Germany)
Tormy wrote:
to have this bug solved in a next release please?

I sincerely doubt that will happen. This limitation has been around since the beginning (15-17 years ago, depending on whether or not PAL was already included in SAM 1)
If you reread the PAL QuickStart Guide you'll notice that even Spacial has made you aware of that limitation...

I think this is due to the fact that "simple" conditions are optimized away by the compiler and the "1 line per second" way that SAM runs PAL scripts instead of as a big chunk run all at once.


There is obviously a workaround and even a very simple one: Just use a loop with only one iteration instead of the condition.

Code:
var test : float = 10;
var runloop : boolean = True;

WHILE test = 10 AND runloop THEN
BEGIN
  runloop := False;
  PAL.WaitForTime('+00:00:10');
  writeLn('END');
END;

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

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


Top
 Profile  
Reply with quote  
PostPosted: November 9th, 2019, 3:02 pm 
Offline
Senior User
Senior User

Joined: September 7th, 2018, 9:00 am
Posts: 108
Mastacheata wrote:
Tormy wrote:
to have this bug solved in a next release please?

I sincerely doubt that will happen. This limitation has been around since the beginning (15-17 years ago, depending on whether or not PAL was already included in SAM 1)
If you reread the PAL QuickStart Guide you'll notice that even Spacial has made you aware of that limitation...

I think this is due to the fact that "simple" conditions are optimized away by the compiler and the "1 line per second" way that SAM runs PAL scripts instead of as a big chunk run all at once.


There is obviously a workaround and even a very simple one: Just use a loop with only one iteration instead of the condition.

Code:
var test : float = 10;
var runloop : boolean = True;

WHILE test = 10 AND runloop THEN
BEGIN
  runloop := False;
  PAL.WaitForTime('+00:00:10');
  writeLn('END');
END;

Well, thanks a million. It worked wonderfully.

About the PAL. Well, there is a .DOC I can't open because on the radio's PC I have not any word program.


Top
 Profile  
Reply with quote  
PostPosted: Yesterday, 7:20 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7880
Location: Aachen (Germany)
Tormy wrote:
Well, there is a .DOC I can't open because on the radio's PC I have not any word program.

This one:
http://support.spacialaudio.com/wiki/PAL_Quick_Start
or this one:
https://support.spacial.com/hc/en-us/ar ... tart-Guide

Contain the doc-file contents as a web page (look for the text: "Now, a few important concepts about waiting:" for details on how to wait conditionally. Overall this guide contains a lot of very basic explanations on coding and a few details/examples of the specialties that PAL has over traditional programming languages)

Sadly the Quick Start Guide hasn't seen any updates since 2005 and therefore doesn't cover the new features like the new Http library or the ability to execute programs/commands outside of SAM for example.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

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


Top
 Profile  
Reply with quote  
PostPosted: Today, 5:07 am 
Offline
Senior User
Senior User

Joined: September 7th, 2018, 9:00 am
Posts: 108
Mastacheata wrote:
Tormy wrote:
Well, there is a .DOC I can't open because on the radio's PC I have not any word program.

This one:
http://support.spacialaudio.com/wiki/PAL_Quick_Start
or this one:
https://support.spacial.com/hc/en-us/ar ... tart-Guide

Contain the doc-file contents as a web page (look for the text: "Now, a few important concepts about waiting:" for details on how to wait conditionally. Overall this guide contains a lot of very basic explanations on coding and a few details/examples of the specialties that PAL has over traditional programming languages)

Sadly the Quick Start Guide hasn't seen any updates since 2005 and therefore doesn't cover the new features like the new Http library or the ability to execute programs/commands outside of SAM for example.


Thanks a million


"ability to execute programs/commands outside of SAM" ???

This can be really useful. I was not aware! Really I would like to have more clue about


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 4 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