Jump to content

Variables


C Martin

Recommended Posts

Is there a possibility that Variables will be added to the iSY programing code?

I think that I may have requested this a long time ago, and I don't remember what the answer was.

It's been a while since I was on-line - been kind of busy.

But I try to follow the Forum every other day or so.

Link to comment

I like the sound of having variables but I am struggling to think of ways I would actually use them. Programming the ISY is more like managing a "State Machine" than it is building an "Application". There is no output console to speak of, although, I would agree that being able to wirite messages to the log or java console could be very helpful. The current functionality of being able to use other programs to detect, store, and manage state seems to give me most of what I need.

 

So here is a question for everyone... Unless coordinated with some other advanced feature, what would you use them for?

 

I could see things like... summing device states could eliminate some complex comditionals but it wouldn't add anything you can't already do.

 

I don't really see a great use for them at this point. I'll bet I am just being shortsighted and people will come up with hundreds of great reasons though. Let's hear'em?

Link to comment

Variables can add to monitoring user defined States. Right now, many people are creating states by monitoring Program states - i.e.. - "if Program 1 is True" .

Using variables would allow the programmers the ability to set States or Conditions inside of programs with what I consider a little more reliability and flexibility.

Variables could make things a little more complicated though - you have to remember to reset them somewhere along the way, and you have to remember their names.

Link to comment

Usings programs for "state" does seem a bit odd at first but once you get used to it, it's quite powerful and easy. I just think it helps to think this through and it seems like kind of a slippery slope to me. If you add variables then you would also have to add types and assignment actions. Then you would have to expand the conditional operators. Then you would have to define scoping rules unless everything is global. Pretty soon you would have to ask... "Why don't we just expose a mini JRE and editor?"

 

The alternative would be to keep the state machine simple and expose it using web services which sounds like a route they may be taking. If you want to develop more complex applications, theoretically, you can write them in any langage, on any machine, anywhere in the world.

 

I guess I am often a big believer the KISS principle and not immune to the latter "S'. :D

Link to comment

I believe in keeping things simple.

We don't need to have types and scopes for variables, they can be just simple place holders.

I am just looking for simple Flags that can give us some programming options.

I now have what I call Flag Programs and it works for me. But, as you stated before, variables will allow us to have Case Statements and expand the "If Conditions" even more.

Link to comment
I am just looking for simple Flags that can give us some programming options.

 

I guess I'm pretty much the same way. If I test if all lamps in a room are on I just want to do it one time and use a simple variable state as a flag. I know you can do it with program status, but that just seems so cumbersome.

And I just want a simple variable that I can set ON or OFF for controlling folders, programs, etc.

Link to comment

Jeff, as I stated in my request for variables, typing and scoping rules are advanced features which may be added at some point in the future if merited, but definitely not required initially. I would think a simple integer variable (either signed or unsigned) would be more than adequate to begin with. Eight-bit variables would be fine, though sixteen would be better.

 

Even such a simple variable could take the place of of many flag programs. The use of variables could likely cut my number of programs by more than half. [i'm already over 300 programs, and just getting started.] Being an Ocelot user, I am quite familiar with the advantages of variables.

 

Then too, variables are essential for any sort of user-programmed calculations. Though calculations have never been promised, I have hope that they may show up at some point. But Michel has already stated that variables will be in a near release, for which I am thankful, and am anxiously awaiting them.

Link to comment

Archived

This topic is now archived and is closed to further replies.


  • Recently Browsing

    • No registered users viewing this page.
  • Forum Statistics

    • Total Topics
      36.9k
    • Total Posts
      370.2k
×
×
  • Create New...