Skip to Content
It is currently September 23rd, 2020, 4:46 am

All times are UTC - 6 hours [ DST ]




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

Joined: September 7th, 2018, 9:00 am
Posts: 115
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: 8060
Location: Cologne (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)

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  
PostPosted: November 9th, 2019, 3:02 pm 
Offline
Senior User
Senior User

Joined: September 7th, 2018, 9:00 am
Posts: 115
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: November 11th, 2019, 7:20 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8060
Location: Cologne (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)

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  
PostPosted: November 12th, 2019, 5:07 am 
Offline
Senior User
Senior User

Joined: September 7th, 2018, 9:00 am
Posts: 115
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  
PostPosted: November 15th, 2019, 6:46 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8060
Location: Cologne (Germany)
Sorry, wish I could've replied quicker, but I'm super busy at work at the moment due to half of my team being sick and having to launch a huge webapp by the end of next week.

Tormy wrote:
"ability to execute programs/commands outside of SAM" ???

As of SAM v2017.8 there is a command called ExecteCmd that allows you to call any executeable on your computer from within PAL.

If you haven't yet upgraded to at least that version, you could use the AutoShell software by Chris Haslage.
AutoShell is basically a webserver/webapp that will execute commands you send it via HTTP requests, meaning you could even use it to run comamnds on different computers.

_________________
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  
PostPosted: November 18th, 2019, 5:31 am 
Offline
Senior User
Senior User

Joined: September 7th, 2018, 9:00 am
Posts: 115
Mastacheata wrote:
Sorry, wish I could've replied quicker, but I'm super busy at work at the moment due to half of my team being sick and having to launch a huge webapp by the end of next week.

Tormy wrote:
"ability to execute programs/commands outside of SAM" ???

As of SAM v2017.8 there is a command called ExecteCmd that allows you to call any executeable on your computer from within PAL.

If you haven't yet upgraded to at least that version, you could use the AutoShell software by Chris Haslage.
AutoShell is basically a webserver/webapp that will execute commands you send it via HTTP requests, meaning you could even use it to run comamnds on different computers.

Very interesting. I have the 2019.3.
This is a feature very useful. I need to test it, to avoid freezings etc as it usually does with some PAL execution.


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

All times are UTC - 6 hours [ DST ]


Who is online

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