View previous topic :: View next topic |
Author |
Message |
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Mon May 01, 2017 8:06 pm Post subject: |
|
|
code like this :
Select Case Lightlevel
Case 102 To 199 : Portb = &B01111111
Case 200 To 399 : Portb = &B10111111
translates to:
if Lightlevel >=102 and LightLevel <200 then
Portb = &B0111_1111
elseif lightlevel >=200 and lightlevel <400 then
Portb = &B1011_1111
etc.
you should check the help and samples. _________________ Mark |
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
|
Back to top |
|
|
six1
Joined: 27 Feb 2009 Posts: 553
|
Posted: Tue May 02, 2017 2:07 pm Post subject: |
|
|
this is absolutly nonsense...
Code: |
Elseif Lightlevel > 899 And Lightlevel > 1022 Then
|
_________________ For technical reasons, the signature is on the back of this message. |
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
Posted: Tue May 02, 2017 2:27 pm Post subject: |
|
|
Why? But it works fine !! |
|
Back to top |
|
|
six1
Joined: 27 Feb 2009 Posts: 553
|
Posted: Tue May 02, 2017 2:58 pm Post subject: |
|
|
You didn't understand the working of "if", "elseif", "else" and maybe also not "boolean operators".
something like:
if 1=0 then....
else
...
endif
is working or better: will be compiled, but makes no sense at all. _________________ For technical reasons, the signature is on the back of this message. |
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
Posted: Tue May 02, 2017 3:07 pm Post subject: |
|
|
is working or better: will be compiled, but makes no sense at all. |
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
Posted: Tue May 02, 2017 3:12 pm Post subject: |
|
|
Printpix52 wrote: | is working or better: will be compiled, but makes no sense at all. |
So correct me I want to see them working fine. |
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
|
Back to top |
|
|
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
Posted: Thu May 04, 2017 1:54 pm Post subject: |
|
|
the big difference between if--endif and select case
let us suppose your level is 103
your program read all line and spend a lot of time for nothing
with if--- endif or if ---elseif --endif
You can do that but add "Exit do" after each choice
with select case
the program goes directly to the good line and exit of the loop after.
JP |
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
Posted: Thu May 04, 2017 3:37 pm Post subject: |
|
|
Hello!! Dubai and the probe does not work. |
|
Back to top |
|
|
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
Posted: Thu May 04, 2017 6:04 pm Post subject: |
|
|
would you like explain what you want to do
jp |
|
Back to top |
|
|
|