¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io
Date

Re: Question on finding the number of defined array elements.

fellatedone
 

Fantastic post. Thank you.

-JOHN

--- In Crestron@..., Chris Erskine <chris@...> wrote:

Over the years, I have programmed in many different languages
starting with assembler and moving up into what are called 4GL and
true Object Oriented languages. They each have their strong points
and their weaknesses. Each have places where they are the better
language for the usage. C was designed to be a higher level language
than assembler but still allow some of the power of assembler with its
pointers.

For some, programming languages are more of a religious war (like
with OS's) where their language or way of programming is the best or
only way. For the good programmers, a language is just a tool where
they find the strengths and weaknesses and how to use it for the job
being done.

Simpl and S+ are just programming languages. We need to learn their
strengths and weaknesses just like any other tool. There are some
places where Simpl is the right tool and some where S+ is the right
one. Since Simpl is the "native" language of the Crestron processors
and is required for everything you do programming in the Crestron
environment, it is the one that most time should be spent on. When
you find places S+ is the better language, use it but also understand
where it should and should not be used.

I know that in this environment, I am not one of your 'cream of the
crop' programmers. I am still trying to learn this envirnoment. The
way this type of group works isif you can help, do so. Some of the
times when you try to help, you find you are wrong but most of the
times, you are not. Some of the times, you find that you may be right
but there is a better way.

Chris


-----Original Message-----
From: Crestron@... [mailto:Crestron@...] On
Behalf Of Matt
Sent: Friday, January 23, 2009 5:10 PM
To: Crestron@...
Subject: [Crestron] Re: Question on finding the number of defined
array elements.

...I'm not knocking anyone here; we all
have to start somewhere, but there do appear to be a lot of guys
programming systems with some pretty shaky foundations in procedural
languages, and even simple syntactic issues (like the root of this
thread) could wreak havoc scrambling your processor's brains. So I
suppose you could argue "Pointers don't kill processors, programmers
do" ;-)


Hey, I resemble that comment. ;)

But in all honesty, I think the majority of Crestron programmers
don't have procedural backgrounds, and don't really need to, it's not
a procedural language, some people might even say that it's not MEANT
to be programmed with S+.

A lot of the programmers here are the 'cream of the crop' and I for
one appreciate the help, but I also like to think I help as well.
Sure, not with pointers or 'dynamic memory assignment' or what-have-
you, and also make syntax errors that I ask about, but helping out
with a 'I can't figure out how the example checksum is calculated' is
good too...right? ;)




------------------------------------



Check out the Files area for useful modules, documents, and drivers.

A contact list of Crestron dealers and programmers can be found in
the Database area.
Yahoo!
Groups Links


Re: Question on finding the number of defined array elements.

Chris Erskine
 

Over the years, I have programmed in many different languages starting with assembler and moving up into what are called 4GL and true Object Oriented languages. They each have their strong points and their weaknesses. Each have places where they are the better language for the usage. C was designed to be a higher level language than assembler but still allow some of the power of assembler with its pointers.

For some, programming languages are more of a religious war (like with OS's) where their language or way of programming is the best or only way. For the good programmers, a language is just a tool where they find the strengths and weaknesses and how to use it for the job being done.

Simpl and S+ are just programming languages. We need to learn their strengths and weaknesses just like any other tool. There are some places where Simpl is the right tool and some where S+ is the right one. Since Simpl is the "native" language of the Crestron processors and is required for everything you do programming in the Crestron environment, it is the one that most time should be spent on. When you find places S+ is the better language, use it but also understand where it should and should not be used.

I know that in this environment, I am not one of your 'cream of the crop' programmers. I am still trying to learn this envirnoment. The way this type of group works isif you can help, do so. Some of the times when you try to help, you find you are wrong but most of the times, you are not. Some of the times, you find that you may be right but there is a better way.

Chris

-----Original Message-----
From: Crestron@... [mailto:Crestron@...] On Behalf Of Matt
Sent: Friday, January 23, 2009 5:10 PM
To: Crestron@...
Subject: [Crestron] Re: Question on finding the number of defined array elements.

...I'm not knocking anyone here; we all
have to start somewhere, but there do appear to be a lot of guys
programming systems with some pretty shaky foundations in procedural
languages, and even simple syntactic issues (like the root of this
thread) could wreak havoc scrambling your processor's brains. So I
suppose you could argue "Pointers don't kill processors, programmers
do" ;-)


Hey, I resemble that comment. ;)

But in all honesty, I think the majority of Crestron programmers
don't have procedural backgrounds, and don't really need to, it's not
a procedural language, some people might even say that it's not MEANT
to be programmed with S+.

A lot of the programmers here are the 'cream of the crop' and I for
one appreciate the help, but I also like to think I help as well.
Sure, not with pointers or 'dynamic memory assignment' or what-have-
you, and also make syntax errors that I ask about, but helping out
with a 'I can't figure out how the example checksum is calculated' is
good too...right? ;)




------------------------------------



Check out the Files area for useful modules, documents, and drivers.

A contact list of Crestron dealers and programmers can be found in the Database area.
Yahoo! Groups Links


Re: Newbie Simpl+ Question

 

Hi Chris,

I have been using a simpl+ macro for some time that is doing
something like that.

My inputs are
Touchpanel in use
Room in use
Menu in use
Direct selection of a voice
Max Pages for each menu(array)

outputs are
array of menus containing page selected for each menu
with an analog equate you feedback pages so that each zone has its
own menu Functions: light,av etc,
av equip: sky, dvd
av out: plasma vp (for each room)

I use one macro per touchpanel. I could actually use the single macro
for the whole project... but i prefer splitting things up

the framework in simpl uses crosspoints to handle matrix, devices,
etc everything that is global for zones and devices

raf


--- In Crestron@..., "scates98" <ccates98@...> wrote:

Hey Chip,

Thanks for your reply! I spent about a day or two trying to figure
out how I could program this in SIMPL+ and eventually gave up
because
I couldn't figure out how to do it. I went back to SIMPL Windows
and
continued writing the module. When I look at the code I've written
in
SIMPL Windows it just looks like a lot of code and when I see my
code
go that way I start thinking I've made things too complicated. My
paranoia starts going because I think signals won't be resolved in
logic waves and then things won't work exactly as they should. I've
done all I can to keep the code down to it's minimum so things will
work efficiently.

Since the menu is going to be generated by a TPS-GA-TPI (touchpanel
interface for standard display devices) there will be no touch input
to navigate the menu. The only device to interface with the menu
being displayed will be an ML-600 remote. When the user presses
Menu
on the ML-600, I want the Menu to toggle on/off. They will then
have
to use the direction pad to navigate the on-screen menu. I've
broken
this down into two components, Menu Selection and Menu Control which
is selected by the left/right dirpad buttons. When in Menu
Selection
mode the user is choosing from the list of rooms, sources, lights,
shades, etc. when the user is in Menu Control mode the user is
selecting options from the current Menu Selection. Example, when
the
user selected rooms from the Menu Selection they immediately switch
to
Menu Control mode and start choosing a floor followed by a room.
The
inputs are fairly simple dirpad signals and such to control
navigation. Output signals are to switch between pages and subpages
for menu navigation. Example: pressing the Enter button on the
dirpad
when selecting Rooms from the Menu Selection list will switch the
TPS-GA-TPI to display the room selection page and force the Floor
Selection subpage high. After using the up/down dirpad buttons the
user will select a floor and press the dirpad enter button again to
choose a floor which will display the room list for that floor.

This is why I was thinking of using an array. In SIMPL Windows I
control this using a Ring Counter with Seed so I can send an analog
value to the Ring counter to turn all outputs off or force one on.
This in conjunction with interlocks help to enable the correct
buffer
for navigational control. If I knew how to create a buffer in
SIMPL+
I might have enough to make the module work. However, I keep
thinking
I'm reinventing the wheel if all I'm doing is making the same
signals
in SIMPL+ that I've already written in SIMPL Windows.

I hope this answers your question. I appreciate your input and
perhaps you're right. Maybe I should keep this in SIMPL Windows. At
least I'll know how to troubleshoot it! lol

Thanks,

- Chris


--- In Crestron@..., "Chip Moody" <cfm@> wrote:


I'm certainly not going to steer you away from diving into S+,
but
I'm going to question whether what you're trying to accomplish in
this
case is better off left in SIMPL. Based on what you've
described, it
doesn't sound like you're going to be pushing the limits on the
processor by any means - even if you had 16 instances of
the "block"
of code AND had 16 people pounding buttons in each zone at the
same
time. (16 instances of a block of code with a zillion signals
where
only one instance is going to be used by the client at any one
time is
pretty much a non-issue)

If you want to neaten things up a bit, get the block to a point
where you think it's got all the goezintas and goezouttas you
need,
and turn it into a SIMPL module. Then you can just drop 16
instances
of the completed module into your program. No, it doesn't make
any
difference on processing - it'll just make your main program's
code
easier to read through and maintain.

If you're still interested in making an S+ version for
self-educational purposes at the very least, could you describe
the
signals going in/out a bit more? I wasn't able to get a clear
enough
picture to advise/suggest S+ approaches.

- Chip


--- In Crestron@..., "scates98" <ccates98@> wrote:

Hi all,

Sorry for the long post, but I like to give a lot of details to
help
people understand what I'm trying to do. I'm an experienced
SIMPL
Windows programmer but SIMPL+ is still pretty new to me. I'm
trying
to find a way to program a custom menu subsystem for my client
and was
hoping someone could help me in building this in SIMPL+.

The client will be using an ML-600 and he's only going to be
using
some basic inputs like: dirpad up/down/left/right/enter and page
up/down on the remote to navigate an on-screen display
generated by a
TPS-GA-TPI. He wants to have the ability to control any zone
in the
house. So I've created a GUI so he can select room control,
source
control, lighting control, climate control, shade control and
security
control.

In SIMPL Windows I am using a series of buffers and interlocks
to
control when the dirpad up/down/left...etc. signals are in use
for a
particular menu. I am also using a series of Ring Counter with
Seed
symbols to allow him to navigate the on-screen menu using only
the
dirpad on the ML-600. Example: the user selects "Choose Room"
from
the primary menu, then uses the ring counter to scroll through
the
floors, another ring counter controls the scrolling through
rooms for
the selected floor.

As I'm building this project, I am noticing that my menu
system, built
in SIMPL Windows, is creating a lot of signals and I'm
concerned with
how well it will function after I've duplicated it for all
zones which
require it (at least 16 zones). I know that if I were to build
this
in SIMPL+ it would be much more efficient and easier to copy,
but I am
confused on how I could write it as I'm not experienced in
SIMPL+. I
thought of using an array to create a table where the first row
would
contain values for the primary menu (rooms, sources, lights,
etc.).
Then each column would contain values for each of the primary
menu
items (ex: 1=first floor, 2=main floor, 3=upper floor, etc.).
However
I do not understand how to buffer the dirpad up/down commands to
control the scrolling through the list. I keep thinking about
using
an IF statement but then I'm writing a large amount of nested IF
statements to control when the up/down command is enabled for a
specific menu. Perhaps using a long SWITCH/CASE statement would
work?

Any help you can provide would be greatly appreciated as I know
I need
to get my head into SIMPL+ programming to become a better
programmer.
Please try not to get too technical with your replies as I'm
still
new to programming this way and can get lost quickly.

Thanks In Advance For All Your Help,

- Scates

P.S. I've read the SIMPL+ programming help PDF and it's helped
me to
get this far. I really need to take some sort of programming
class to
better learn this.


Re: Simpl+ Parameters

Steve Kaudle
 

The line would look something like:

digital_input _skip_, input1, input2;

Add as many instances of "_skip_" as you have parameters.

The same method can be applied to the output, or you can use the
declaration "#output_shift X", where X is the number of spaces you
want the first output shifted down.

Why there is no "#input_shift" declaration is anybody's guess?

--- In Crestron@..., roomy4545 <roomy4545@...> wrote:

So how do you type it?

should it be "digital_input test1"_SKIP_
then parameters (that's how i'm doing it)

or should it be the parameters first then skip then the digital inputs?


or should the skip then digital parameters...?

Could you show an example


________________________________
From: maxpower68 <maxpower68@...>
To: Crestron@...
Sent: Saturday, January 24, 2009 12:01:39 AM
Subject: [Crestron] Re: Simpl+ Parameters


Yes se the "_SKIP_" this will drop the digital inputs below the
parameters. This is the only way to do this. It's back ass wards but
it works.

Max

--- In Crestron@yahoogroup s.com, roomy4545 <roomy4545@ ..> wrote:

Anyone know why with my simpl+ the digital inputs are on the same
line as parameters (when you look at the symbol in Simpl?). Is there
a way you are supposed to declare them so i can see the names of the
digital/serial input names and for the parameters to go at the bottom
of the symbol.
?
As it stands now, the paraters start at the top of the symbol and
go down. I tried using the "_SKIP_" to try to create space between my
input symbols and the parameters.
?
Any help would be appreciated




[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]


Re: Simpl+ Parameters

roomy4545
 

So how do you type it?

should it be "digital_input test1"_SKIP_
then parameters (that's how i'm doing it)

or should it be the parameters first then skip then the digital inputs?


or should the skip then digital parameters...?

Could you show an example


________________________________
From: maxpower68 <maxpower68@...>
To: Crestron@...
Sent: Saturday, January 24, 2009 12:01:39 AM
Subject: [Crestron] Re: Simpl+ Parameters


Yes se the "_SKIP_" this will drop the digital inputs below the
parameters. This is the only way to do this. It's back ass wards but
it works.

Max

--- In Crestron@yahoogroup s.com, roomy4545 <roomy4545@. ..> wrote:

Anyone know why with my simpl+ the digital inputs are on the same
line as parameters (when you look at the symbol in Simpl?). Is there
a way you are supposed to declare them so i can see the names of the
digital/serial input names and for the parameters to go at the bottom
of the symbol.
?
As it stands now, the paraters start at the top of the symbol and
go down. I tried using the "_SKIP_" to try to create space between my
input symbols and the parameters.
?
Any help would be appreciated




[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]


Re: Simpl+ Parameters

 

Yes se the "_SKIP_" this will drop the digital inputs below the
parameters. This is the only way to do this. It's back ass wards but
it works.

Max






--- In Crestron@..., roomy4545 <roomy4545@...> wrote:

Anyone know why with my simpl+ the digital inputs are on the same
line as parameters (when you look at the symbol in Simpl?). Is there
a way you are supposed to declare them so i can see the names of the
digital/serial input names and for the parameters to go at the bottom
of the symbol.
?
As it stands now, the paraters start at the top of the symbol and
go down. I tried using the "_SKIP_" to try to create space between my
input symbols and the parameters.
?
Any help would be appreciated






Re: Simpl+ Parameters

Christopher Schley
 

Yeah, the instructor had to skip the inputs to get them below the
parameters

On Jan 23, 2009, at 21:09, roomy4545 <roomy4545@...> wrote:

Anyone know why with my simpl+ the digital inputs are on the same
line as parameters (when you look at the symbol in Simpl?). Is there
a way you are supposed to declare them so i can see the names of the
digital/serial input names and for the parameters to go at the
bottom of the symbol.

As it stands now, the paraters start at the top of the symbol and go
down. I tried using the "_SKIP_" to try to create space between my
input symbols and the parameters.

Any help would be appreciated




Simpl+ Parameters

roomy4545
 

Anyone know why with my simpl+ the digital inputs are on the same line as parameters (when you look at the symbol in Simpl?). Is there a way you are supposed to declare them so i can see the names of the digital/serial input names and for the parameters to go at the bottom of the symbol.
?
As it stands now, the paraters start at the top of the symbol and go down. I tried using the "_SKIP_" to try to create space between my input symbols and the parameters.
?
Any help would be appreciated




[Non-text portions of this message have been removed]


Re: vtpro-e hang time

fellatedone
 

I do find that 6L's are slower than 8X, but not much and nowhere near
the drag that 2000's are.

I also found that my desktop takes longer to compile (quad core) than
my laptop (dual core).

-JOHN

--- In Crestron@..., "Nightcountry" <patrickbedford@...>
wrote:

--- In Crestron@..., Chris Erskine <chris@> wrote:

How much memory is in your PC and what is the usage of the memory
when you are compiling? Does it exceed the physical memory so that it
starts swapping?

Hey Chris
I have 6 gig of ddr3 memory but because I am using xp, the os only
sees 3.24 gig - vt uses 300,000 kb in memory usage when I working on
the program - am using the new I-7 intel processing ship as well -
the memory usage is so massive that I suspect it is the culprit but
my old pc using a P3 processor would use only 70-80000 kb of memory
when using vt.....

Chris


-----Original Message-----
From: Crestron@... [mailto:Crestron@...] On
Behalf Of Nightcountry
Sent: Friday, January 23, 2009 9:49 AM
To: Crestron@...
Subject: [Crestron] Re: vtpro-e hang time

--- In Crestron@..., "scates98" <ccates98@> wrote:

I experience this problems on some panels as well but I just have to
wait a minute or two and it always finishes. I've found that I
really
have to be careful not to use too many fonts in my projects as it
causes the compile time to slow down as wall as keeps the file size
too large for some panels. My recommendation to you is to eliminate
any unnecessary fonts and give it another go.

- Ccates
Thanks - the file size I am using with the tps6l is around 10 meg
however the panels capacity is 28 - when you say eliminate unnecessary
fonts do you mean the number of font styles or just text information?
Cheers



--- In Crestron@..., "Nightcountry" <patrickbedford@>
wrote:

Hi is anyone else having a problem when compiling a vtpro
program -
pc hangs at 50 percent when loading fonts and sometimes freezes
completely - another installer I know is having the same issues
.....
the program is taking 300,000 kb in memory - have an I-7 processor
with 6 gigs of ram
and am still having problems - with vt 3.8 and now with vt 3.9
thanks


------------------------------------



Check out the Files area for useful modules, documents, and drivers.

A contact list of Crestron dealers and programmers can be found in
the Database area.
Yahoo!
Groups Links


TPMC-4XG System Bar

Rick Ciaccio
 

I have one that's acting up...

The system bar shows up on every page until I uncheck the global box in
properties... then it disappears from all pages even though several pages have
it enabled and in visible mode with default join #.

Crestron support couldn't help.

Any ideas?

-R


Re: Question on finding the number of defined array elements.

Matt
 

...I'm not knocking anyone here; we all
have to start somewhere, but there do appear to be a lot of guys
programming systems with some pretty shaky foundations in procedural
languages, and even simple syntactic issues (like the root of this
thread) could wreak havoc scrambling your processor's brains. So I
suppose you could argue "Pointers don't kill processors, programmers
do" ;-)


Hey, I resemble that comment. ;)

But in all honesty, I think the majority of Crestron programmers
don't have procedural backgrounds, and don't really need to, it's not
a procedural language, some people might even say that it's not MEANT
to be programmed with S+.

A lot of the programmers here are the 'cream of the crop' and I for
one appreciate the help, but I also like to think I help as well.
Sure, not with pointers or 'dynamic memory assignment' or what-have-
you, and also make syntax errors that I ask about, but helping out
with a 'I can't figure out how the example checksum is calculated' is
good too...right? ;)


Re: Question on finding the number of defined array elements.

Joseph K. Vossen
 

that's how many implementations of strtok(3) work.

On Friday 23 January 2009 06:18 pm, you wrote:
Oh Duh... Sorry, I forgot the whole part about being able to point to
individual character positions in a "string".

Makes much more sense


Re: Question on finding the number of defined array elements.

 

Oh Duh... Sorry, I forgot the whole part about being able to point to individual character positions in a "string".

Makes much more sense

--
Lincoln King-Cliby, CTS
Applications Engineer
ControlWorks Consulting, LLC
V: 440.729.4640 x1107 F: 440.729.0884 I:
Crestron Authorized Independent Programmer

-----Original Message-----
From: Crestron@... [mailto:Crestron@...] On Behalf Of Chris Erskine
Sent: Friday, January 23, 2009 6:17 PM
To: Crestron@...
Subject: RE: RE: [Crestron] Re: Question on finding the number of defined array elements.

One of the things that I would do with pointers was for strings with delimiters, you would null out the delimiter and by using pointers, you could point to the start of the string without having to copy the data into new fields. There are a number of other uses that they can be used for but that was the one I was thinking about when Joseph talked about breaking up the XML files.



Chris


-----Original Message-----
From: Crestron@... [mailto:Crestron@...] On Behalf Of Lincoln King-Cliby
Sent: Friday, January 23, 2009 4:08 PM
To: 'Crestron@...'
Subject: RE: [Crestron] Re: Question on finding the number of defined array elements.

Isn't' that why you pass strings by reference unless you have a good reason for passing them by value (or you're dealing with one of the S+ quirks that won't allow a passing byref, like IIRC, a serial input)?

Or would pointers open up another advantageous option that I'm forgetting at the moment (it's been far too long since the last time I played with a language the formally supported pointers :(... but they are uber cool. Took me most of my first semester of AP CompSci in high school to figure the point out, but after that... wow!)

Lincoln

--
Lincoln King-Cliby, CTS
Applications Engineer
ControlWorks Consulting, LLC
V: 440.729.4640 x1107 F: 440.729.0884 I:
Crestron Authorized Independent Programmer


-----Original Message-----
From: Crestron@... [mailto:Crestron@...] On Behalf Of Chris Erskine
Sent: Friday, January 23, 2009 11:12 AM
To: Crestron@...
Subject: RE: [Crestron] Re: Question on finding the number of defined array elements.

I agree that not only would your code be more compact but more efficient since you would not have to be copying data around all over. On the other hand, pointers would cause so much more problems in the code that systems would be crashing all over. Crestron would require better TB personnel and better tools since you would need a debugger that would let you step through the S+ code when it was running.



Chris

-----Original Message-----
From: Crestron@... [mailto:Crestron@...] On Behalf Of Joseph K. Vossen
Sent: Friday, January 23, 2009 9:06 AM
To: Crestron@...
Subject: Re: [Crestron] Re: Question on finding the number of defined array elements.

agreed...in my non-Crestron circle of travels in the past, I have found that a *good* understanding of pointers separates the good programmers from the great ones. And then when you jump into function pointers, that opens up a whole new world of fun.....





having pointers in SIMPL+ would benefit, for example, those tasks that perform a *lot* of parsing, such as busting up XML pages. Sure one can do it now with what is available, I just think the code would be a bit more compact, IMHO

-----Original Message-----
From: fooguy89 <fooguy89@...>
Sent: Jan 23, 2009 10:53 AM
To: Crestron@...
Subject: [Crestron] Re: Question on finding the number of defined array elements.

I'm pretty sure the reason Crestron doesn't do Pointers is because of
support. They tend to perform a lot of support that doesn't seem to
be "their problem" - issues that are clearly programming mistakes, but
they do try to help resolve them (I know people knock TB for a lot,
but I mean they do try to be helpful if you get the right folks).

Can you just imagine the chaos of newbies trying to use pointers,
overwriting memory, blah blah blah, and Crestron trying to suck it up
and fix it/teach them?

As a professional programmer, sure, it would be great to have, but I
can definitely see why many things are limited.

Sometimes I don't understand the need to try to fix and assist with
blatant programming problems (If you were to call microsoft and whine
about how your system crashed because you did a NULL pointer access or
overwrite the bounds of your array, they'd probably just be like
"Uh....GO FIND AND FIX IT YOURSELF!!")


--- In Crestron@..., Joseph K. Vossen <jkv@...> wrote:

the semi-colon after the if() is a valid statement from the parser's
point of view; it just doesn't do what you want/expect

here is a simple example of how that is useful; the following 'C'
code copies a NULL-terminated string, where 'p' points to the destination and
'q' points to the source:. The while() terminates when the NULL terminating
byte is hit.

while (*p++ = *q++)
; // <- note lone semi-colon

ya' just gotta love pointers...sure wish SIMPL+ had 'em.......

On Friday 23 January 2009 12:33 am, you wrote:
I would have expected to see a compiler error on the fatal ; at the
end of an IF statement.

True, but I always put them in so that if I do add another line I
don't mess up the execution order/nesting. (Didn't see the ; -
fatal, but a trace should have shown 10 outputs rather than just 1.)

Lindsay


------------------------------------



Check out the Files area for useful modules, documents, and drivers.

A contact list of Crestron dealers and programmers can be found in the Database area.
Yahoo! Groups Links




------------------------------------



Check out the Files area for useful modules, documents, and drivers.

A contact list of Crestron dealers and programmers can be found in the Database area.
Yahoo! Groups Links




------------------------------------



Check out the Files area for useful modules, documents, and drivers.

A contact list of Crestron dealers and programmers can be found in the Database area.
Yahoo! Groups Links




------------------------------------



Check out the Files area for useful modules, documents, and drivers.

A contact list of Crestron dealers and programmers can be found in the Database area.
Yahoo! Groups Links


Re: Question on finding the number of defined array elements.

Chris Erskine
 

One of the things that I would do with pointers was for strings with delimiters, you would null out the delimiter and by using pointers, you could point to the start of the string without having to copy the data into new fields. There are a number of other uses that they can be used for but that was the one I was thinking about when Joseph talked about breaking up the XML files.



Chris

-----Original Message-----
From: Crestron@... [mailto:Crestron@...] On Behalf Of Lincoln King-Cliby
Sent: Friday, January 23, 2009 4:08 PM
To: 'Crestron@...'
Subject: RE: [Crestron] Re: Question on finding the number of defined array elements.

Isn't' that why you pass strings by reference unless you have a good reason for passing them by value (or you're dealing with one of the S+ quirks that won't allow a passing byref, like IIRC, a serial input)?

Or would pointers open up another advantageous option that I'm forgetting at the moment (it's been far too long since the last time I played with a language the formally supported pointers :(... but they are uber cool. Took me most of my first semester of AP CompSci in high school to figure the point out, but after that... wow!)

Lincoln

--
Lincoln King-Cliby, CTS
Applications Engineer
ControlWorks Consulting, LLC
V: 440.729.4640 x1107 F: 440.729.0884 I:
Crestron Authorized Independent Programmer


-----Original Message-----
From: Crestron@... [mailto:Crestron@...] On Behalf Of Chris Erskine
Sent: Friday, January 23, 2009 11:12 AM
To: Crestron@...
Subject: RE: [Crestron] Re: Question on finding the number of defined array elements.

I agree that not only would your code be more compact but more efficient since you would not have to be copying data around all over. On the other hand, pointers would cause so much more problems in the code that systems would be crashing all over. Crestron would require better TB personnel and better tools since you would need a debugger that would let you step through the S+ code when it was running.



Chris

-----Original Message-----
From: Crestron@... [mailto:Crestron@...] On Behalf Of Joseph K. Vossen
Sent: Friday, January 23, 2009 9:06 AM
To: Crestron@...
Subject: Re: [Crestron] Re: Question on finding the number of defined array elements.

agreed...in my non-Crestron circle of travels in the past, I have found that a *good* understanding of pointers separates the good programmers from the great ones. And then when you jump into function pointers, that opens up a whole new world of fun.....




having pointers in SIMPL+ would benefit, for example, those tasks that perform a *lot* of parsing, such as busting up XML pages. Sure one can do it now with what is available, I just think the code would be a bit more compact, IMHO

-----Original Message-----
From: fooguy89 <fooguy89@...>
Sent: Jan 23, 2009 10:53 AM
To: Crestron@...
Subject: [Crestron] Re: Question on finding the number of defined array elements.

I'm pretty sure the reason Crestron doesn't do Pointers is because of
support. They tend to perform a lot of support that doesn't seem to
be "their problem" - issues that are clearly programming mistakes, but
they do try to help resolve them (I know people knock TB for a lot,
but I mean they do try to be helpful if you get the right folks).

Can you just imagine the chaos of newbies trying to use pointers,
overwriting memory, blah blah blah, and Crestron trying to suck it up
and fix it/teach them?

As a professional programmer, sure, it would be great to have, but I
can definitely see why many things are limited.

Sometimes I don't understand the need to try to fix and assist with
blatant programming problems (If you were to call microsoft and whine
about how your system crashed because you did a NULL pointer access or
overwrite the bounds of your array, they'd probably just be like
"Uh....GO FIND AND FIX IT YOURSELF!!")


--- In Crestron@..., Joseph K. Vossen <jkv@...> wrote:

the semi-colon after the if() is a valid statement from the parser's
point of view; it just doesn't do what you want/expect

here is a simple example of how that is useful; the following 'C'
code copies a NULL-terminated string, where 'p' points to the destination and
'q' points to the source:. The while() terminates when the NULL terminating
byte is hit.

while (*p++ = *q++)
; // <- note lone semi-colon

ya' just gotta love pointers...sure wish SIMPL+ had 'em.......

On Friday 23 January 2009 12:33 am, you wrote:
I would have expected to see a compiler error on the fatal ; at the
end of an IF statement.

True, but I always put them in so that if I do add another line I
don't mess up the execution order/nesting. (Didn't see the ; -
fatal, but a trace should have shown 10 outputs rather than just 1.)

Lindsay


------------------------------------



Check out the Files area for useful modules, documents, and drivers.

A contact list of Crestron dealers and programmers can be found in the Database area.
Yahoo! Groups Links




------------------------------------



Check out the Files area for useful modules, documents, and drivers.

A contact list of Crestron dealers and programmers can be found in the Database area.
Yahoo! Groups Links




------------------------------------



Check out the Files area for useful modules, documents, and drivers.

A contact list of Crestron dealers and programmers can be found in the Database area.
Yahoo! Groups Links


Re: Question on finding the number of defined array elements.

 

Isn't' that why you pass strings by reference unless you have a good reason for passing them by value (or you're dealing with one of the S+ quirks that won't allow a passing byref, like IIRC, a serial input)?

Or would pointers open up another advantageous option that I'm forgetting at the moment (it's been far too long since the last time I played with a language the formally supported pointers :(... but they are uber cool. Took me most of my first semester of AP CompSci in high school to figure the point out, but after that... wow!)

Lincoln

--
Lincoln King-Cliby, CTS
Applications Engineer
ControlWorks Consulting, LLC
V: 440.729.4640 x1107 F: 440.729.0884 I:
Crestron Authorized Independent Programmer

-----Original Message-----
From: Crestron@... [mailto:Crestron@...] On Behalf Of Chris Erskine
Sent: Friday, January 23, 2009 11:12 AM
To: Crestron@...
Subject: RE: [Crestron] Re: Question on finding the number of defined array elements.

I agree that not only would your code be more compact but more efficient since you would not have to be copying data around all over. On the other hand, pointers would cause so much more problems in the code that systems would be crashing all over. Crestron would require better TB personnel and better tools since you would need a debugger that would let you step through the S+ code when it was running.



Chris

-----Original Message-----
From: Crestron@... [mailto:Crestron@...] On Behalf Of Joseph K. Vossen
Sent: Friday, January 23, 2009 9:06 AM
To: Crestron@...
Subject: Re: [Crestron] Re: Question on finding the number of defined array elements.

agreed...in my non-Crestron circle of travels in the past, I have found that a *good* understanding of pointers separates the good programmers from the great ones. And then when you jump into function pointers, that opens up a whole new world of fun.....



having pointers in SIMPL+ would benefit, for example, those tasks that perform a *lot* of parsing, such as busting up XML pages. Sure one can do it now with what is available, I just think the code would be a bit more compact, IMHO

-----Original Message-----
From: fooguy89 <fooguy89@...>
Sent: Jan 23, 2009 10:53 AM
To: Crestron@...
Subject: [Crestron] Re: Question on finding the number of defined array elements.

I'm pretty sure the reason Crestron doesn't do Pointers is because of
support. They tend to perform a lot of support that doesn't seem to
be "their problem" - issues that are clearly programming mistakes, but
they do try to help resolve them (I know people knock TB for a lot,
but I mean they do try to be helpful if you get the right folks).

Can you just imagine the chaos of newbies trying to use pointers,
overwriting memory, blah blah blah, and Crestron trying to suck it up
and fix it/teach them?

As a professional programmer, sure, it would be great to have, but I
can definitely see why many things are limited.

Sometimes I don't understand the need to try to fix and assist with
blatant programming problems (If you were to call microsoft and whine
about how your system crashed because you did a NULL pointer access or
overwrite the bounds of your array, they'd probably just be like
"Uh....GO FIND AND FIX IT YOURSELF!!")


--- In Crestron@..., Joseph K. Vossen <jkv@...> wrote:

the semi-colon after the if() is a valid statement from the parser's
point of view; it just doesn't do what you want/expect

here is a simple example of how that is useful; the following 'C'
code copies a NULL-terminated string, where 'p' points to the destination and
'q' points to the source:. The while() terminates when the NULL terminating
byte is hit.

while (*p++ = *q++)
; // <- note lone semi-colon

ya' just gotta love pointers...sure wish SIMPL+ had 'em.......

On Friday 23 January 2009 12:33 am, you wrote:
I would have expected to see a compiler error on the fatal ; at the
end of an IF statement.

True, but I always put them in so that if I do add another line I
don't mess up the execution order/nesting. (Didn't see the ; -
fatal, but a trace should have shown 10 outputs rather than just 1.)

Lindsay


------------------------------------



Check out the Files area for useful modules, documents, and drivers.

A contact list of Crestron dealers and programmers can be found in the Database area.
Yahoo! Groups Links




------------------------------------



Check out the Files area for useful modules, documents, and drivers.

A contact list of Crestron dealers and programmers can be found in the Database area.
Yahoo! Groups Links


Re: Question on finding the number of defined array elements.

 

That that is almost exactly what came out of conversation I had with someone fairly high up in the software world of things an Infocomm or two ago, and also the difficulty of protecting the relative "sandbox" that SIMPL+ plays in.

Lincoln

--
Lincoln King-Cliby, CTS
Applications Engineer
ControlWorks Consulting, LLC
V: 440.729.4640 x1107 F: 440.729.0884 I:
Crestron Authorized Independent Programmer

-----Original Message-----
From: Crestron@... [mailto:Crestron@...] On Behalf Of fooguy89
Sent: Friday, January 23, 2009 10:53 AM
To: Crestron@...
Subject: [Crestron] Re: Question on finding the number of defined array elements.

I'm pretty sure the reason Crestron doesn't do Pointers is because of
support. They tend to perform a lot of support that doesn't seem to
be "their problem" - issues that are clearly programming mistakes, but
they do try to help resolve them (I know people knock TB for a lot,
but I mean they do try to be helpful if you get the right folks).

Can you just imagine the chaos of newbies trying to use pointers,
overwriting memory, blah blah blah, and Crestron trying to suck it up
and fix it/teach them?

As a professional programmer, sure, it would be great to have, but I
can definitely see why many things are limited.

Sometimes I don't understand the need to try to fix and assist with
blatant programming problems (If you were to call microsoft and whine
about how your system crashed because you did a NULL pointer access or
overwrite the bounds of your array, they'd probably just be like
"Uh....GO FIND AND FIX IT YOURSELF!!")





--- In Crestron@..., Joseph K. Vossen <jkv@...> wrote:

the semi-colon after the if() is a valid statement from the parser's
point of
view; it just doesn't do what you want/expect

here is a simple example of how that is useful; the following 'C'
code copies
a NULL-terminated string, where 'p' points to the destination and
'q' points
to the source:. The while() terminates when the NULL terminating
byte is hit.

while (*p++ = *q++)
; // <- note lone
semi-colon

ya' just gotta love pointers...sure wish SIMPL+ had 'em.......

On Friday 23 January 2009 12:33 am, you wrote:
I would have expected to see a compiler error on the fatal ; at the
end of an IF statement.

True, but I always put them in so that if I do add another line I
don't mess up the execution order/nesting. (Didn't see the ; -
fatal, but a trace should have shown 10 outputs rather than just 1.)

Lindsay
[snip]


------------------------------------



Check out the Files area for useful modules, documents, and drivers.

A contact list of Crestron dealers and programmers can be found in the Database area.
Yahoo! Groups Links


Re: A wireless router for every rack...?

Jeremy Weatherford
 

Good luck convincing your local IT Mafia^WDepartment of this.

Jeremy

On Fri, Jan 23, 2009 at 3:31 PM, Matt <mjrtoo@...> wrote:
I agree, there's a lot of talk about 'poorly configured' and 'rouge
routers'. IMHO that shouldn't even be part of the discussion,
because if we put them in, they should be properly configured AND not
rouge.


Re: A wireless router for every rack...?

Matt
 

It's sad...very, very sad when you read on a pizza box 'remove
plastic from pizza before cooking'.



In a country where you can sue because the chainsaw did not have a
prominently displayed warning "Do not try to stop the moving chain
with your
bare hands" anything is possible. And, in California it could be
considered
likely.


_____

From: Crestron@... [mailto:Crestron@...] On
Behalf
Of fooguy89
Sent: Friday, January 23, 2009 1:17 PM
To: Crestron@...
Subject: [Crestron] Re: A wireless router for every rack...?



Is that really true - if you have a legal signoff they can still
hold
you responsible? Then what's the point of a signoff, in general?

(Note that I think having a WAP installed by default is a bad idea
as
much as the rest of the people here.)

--- In Crestron@yahoogroup <mailto:Crestron%40yahoogroups.com>
s.com, Jason
Dravet <jason.dravet@> wrote:
Even if in the equipment specs you say you are installing a AP and
the customer signs off you might be responsible as the customer
really
doesn't know what he is signing for and the AP has no legitimate
function.









Re: A wireless router for every rack...?

Matt
 

I agree, there's a lot of talk about 'poorly configured' and 'rouge
routers'. IMHO that shouldn't even be part of the discussion,
because if we put them in, they should be properly configured AND not
rouge.



You know, I can see some bored CS or EE students screwing with a
classroom
system just for kicks, that is how we learn ;) But, in the real
world who
has the time and resources, inclination and product knowledge to do
this
sort of hacking on a system where there is not the slightest profit
in doing
so. Why not spend their time trying to hack into Obama's
Crackberry if they
want some fun? WRT to drapes and other motorized devices, your
program or
your hardware should make such jammage impossible, because it is
much more
likely that a user (most are dangerous) will damage something. I
know, you
were just trying to provide an illustrative example. I guess if I
was
worried about it I would be more concerned about someone
initializing the
processor and wiping out the program. But, unless you are familiar
with
control systems it would take quite a bit of fishing to figure out
how to do
it. My old linksys with talisman firmware never forgets who it is,
and I
can turn down the transmit power so the signal is unavailable at
the street.

If you think through the application and select the proper
component and
settings, as with any portion of the system, it will most likely do
what you
intended without causing trouble. After all, knowing how to do all
that is
why we get the big bucks.

JM$.02

Kol


_____

From: Crestron@... [mailto:Crestron@...] On
Behalf
Of Jason Dravet
Sent: Friday, January 23, 2009 12:34 PM
To: Crestron@...
Subject: Re: [Crestron] A wireless router for every rack...?



--- On Wed, 1/21/09, uscurtin <jcurtin@usc. <mailto:jcurtin%
40usc.edu> edu>
wrote:
The setup:
So my boss has recently decided that a wireless router
should be put
in place into every rack we install from now on (or build,
if multiple
racks exist in a single build) so that a tech can hook up
to the rack
wirelessly whenever they need to service the rack. This
mandate
extends for all racks, regardless of whether or not
wireless products
exist in the build (since the router is primarily for
service).

I have more than several reservations against this notion,
but rather
than share them immediately, I was wondering what the rest
of you
thought of this concept. I'm interested in all sides
of the argument,
so please post whatever thoughts you have on this idea.

-Justin
Personally I don't like wireless. Most are not secure (and I am not
just
talking about WEP/WPA. A friend just purchased a Wireless AP and
installed
it. The router was a NetGear wpn842 I think. It worked great after I
installed it. When I install equipment I always check for updated
firmware.
It is a good thing to as router would lose its settings after a
power
failure without this update. Two weeks later his house lost power
and all of
the settings were erased. That router was returned and another
purchased
from a different vendor. But this illustrates APs have to be
maintained
whereas popular belief is set it up and forgot about it.

For installs I do for business I usually spec Cisco as people know
Cisco.
But having extra functions just because is not a good thing. Even
if the AP
is strictly for Crestron and not connected to the home or internet
it is a
way in. If someone were to hack into the network via a AP that the
customer
didn't spec or know about who knows what trouble the hacker could
get into.
You might be responsible for any damage that occurred. Say the
hacker
figures out how to open and close the curtains. Depending on the
motor he
could overheat it (open/close repeatedly, or figure out how to jam
up the
motor) and cause a fire. Even if in the equipment specs you say you
are
installing a AP and the customer signs off you might be responsible
as the
customer really doesn't know what he is signing for and the AP has
no
legitimate function.

Of course always check with a lawyer.
Jason







[Non-text portions of this message have been removed]


Re: A wireless router for every rack...?

 

In a country where you can sue because the chainsaw did not have a
prominently displayed warning "Do not try to stop the moving chain with your
bare hands" anything is possible. And, in California it could be considered
likely.


_____

From: Crestron@... [mailto:Crestron@...] On Behalf
Of fooguy89
Sent: Friday, January 23, 2009 1:17 PM
To: Crestron@...
Subject: [Crestron] Re: A wireless router for every rack...?



Is that really true - if you have a legal signoff they can still hold
you responsible? Then what's the point of a signoff, in general?

(Note that I think having a WAP installed by default is a bad idea as
much as the rest of the people here.)

--- In Crestron@yahoogroup <mailto:Crestron%40yahoogroups.com> s.com, Jason
Dravet <jason.dravet@...> wrote:
Even if in the equipment specs you say you are installing a AP and
the customer signs off you might be responsible as the customer really
doesn't know what he is signing for and the AP has no legitimate
function.