Why are there only variables of the type byte, integer, string and float?
Unsigned integer and longint would be verry welcome. I can't imagine that the c-compiler the code is transformed to does not have these type of variables.
Type of variables
Moderator: Benj
-
- Posts: 48
- Joined: Mon Apr 07, 2008 9:18 pm
- Has thanked: 23 times
- Been thanked: 8 times
- Contact:
Re: Type of variables
MM guys, any coment on this message would be appreciated.ncc1502 wrote:Why are there only variables of the type byte, integer, string and float?
Unsigned integer and longint would be verry welcome. I can't imagine that the c-compiler the code is transformed to does not have these type of variables.
Better safe then sorry
- Steve
- Matrix Staff
- Posts: 3418
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
Re: Type of variables
I agree that these would be a good addition to Flowcode. However, I want to be careful to keep Flowcode simple to use and I do not want to "flood" it with an excessive amount of data types.
We will seriously consider the expansion of data types. My current favourites to add are a 32-bit signed LONGINT and a 1-bit BOOL.
If anyone has any opinions on future datatypes for Flowcode, then I welcome any comments or suggestions...
We will seriously consider the expansion of data types. My current favourites to add are a 32-bit signed LONGINT and a 1-bit BOOL.
If anyone has any opinions on future datatypes for Flowcode, then I welcome any comments or suggestions...
-
- Posts: 48
- Joined: Mon Apr 07, 2008 9:18 pm
- Has thanked: 23 times
- Been thanked: 8 times
- Contact:
Re: Type of variables
Thanks for your reply Steve.
What i am concernd longint is needed, unsigned integer is sometimes handy, but not nececary (if needed a longint will do the job).
A bool would be nice, will it cut memory usage or is it the same as byte?
With bool type variable, will things like: if name then..... be possible?
What i am concernd longint is needed, unsigned integer is sometimes handy, but not nececary (if needed a longint will do the job).
A bool would be nice, will it cut memory usage or is it the same as byte?
With bool type variable, will things like: if name then..... be possible?
Better safe then sorry
- Steve
- Matrix Staff
- Posts: 3418
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
Re: Type of variables
A bool will probably take a single bit. And you can do "if <name> then..." now with a byte variable if you like (this treats a value of zero as "false" and anything else as "true").
-
- Posts: 77
- Joined: Mon Jan 03, 2011 8:58 pm
- Has thanked: 29 times
- Been thanked: 10 times
- Contact:
Re: Type of variables
Dear Steve,
I'd really appreciate an unsigned INT.
If you're working with 16 bit registers on the AVR this type is absolutely essential, if you don't want to waste memory or calculate with HbLB long-winded...
I'd really appreciate an unsigned INT.
If you're working with 16 bit registers on the AVR this type is absolutely essential, if you don't want to waste memory or calculate with HbLB long-winded...
-
- Flowcode V4 User
- Posts: 36
- Joined: Thu Sep 01, 2011 11:10 am
- Has thanked: 17 times
- Been thanked: 1 time
- Contact:
Re: Type of variables
Hi Steve n all friends,
For Unsigned Integer, for me is very very very useful in:
1. Do loop in very specific time ( especially in control multiple servo ,, i have difficulty setting a few servo in last project ) this due that I also use ADC at same time.
2. If use interrupt , I'm afraid the interrupt timer will affect the ADC value if the ADC in processing when interrupt occur.
3. If using long int, that will be over kill and a waste of memory space if using low end PIC with low memory.
4. I just use C code for that reason ( for set a few servo ).
5. Normally I use ' while/loop until ' if there is some sensitive process ie. ADC etc, to set time and this the main purpose for UNSIGNED INT is really required.
So, if not so much problem, hopefully we can have the UNSIGNED INT in update v4.x
Rgds
Zuki.
For Unsigned Integer, for me is very very very useful in:
1. Do loop in very specific time ( especially in control multiple servo ,, i have difficulty setting a few servo in last project ) this due that I also use ADC at same time.
2. If use interrupt , I'm afraid the interrupt timer will affect the ADC value if the ADC in processing when interrupt occur.
3. If using long int, that will be over kill and a waste of memory space if using low end PIC with low memory.
4. I just use C code for that reason ( for set a few servo ).
5. Normally I use ' while/loop until ' if there is some sensitive process ie. ADC etc, to set time and this the main purpose for UNSIGNED INT is really required.
So, if not so much problem, hopefully we can have the UNSIGNED INT in update v4.x
Rgds
Zuki.
- Steve
- Matrix Staff
- Posts: 3418
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
Re: Type of variables
Unfortunately, this would be a fairly big change, so only V5 will have this (and other) new data types.allpicproject wrote:So, if not so much problem, hopefully we can have the UNSIGNED INT in update v4.x
-
- Flowcode V4 User
- Posts: 36
- Joined: Thu Sep 01, 2011 11:10 am
- Has thanked: 17 times
- Been thanked: 1 time
- Contact:
Re: Type of variables
Thanks for feedbackSteve wrote:Unfortunately, this would be a fairly big change, so only V5 will have this (and other) new data types.allpicproject wrote:So, if not so much problem, hopefully we can have the UNSIGNED INT in update v4.x
![Very Happy :D](./images/smilies/icon_biggrin.gif)