Nested IF-Statement bug - page 2 - General Discussion and Assistance - CHDK Forum

Nested IF-Statement bug

  • 30 Replies
  • 20034 Views
Re: Nested IF-Statement bug
« Reply #10 on: 04 / October / 2009, 11:08:22 »
Advertisements
Hallo,
I've written a small program, witch should list all if-syntax errors. So everybody can test there scripts.

I found the following scripts are wrong:
Sevenup.bas - http://www.wirklemms.de/chdk/forum/viewtopic.php?t=939
Susi2Stack.bas - http://www.wirklemms.de/chdk/forum/viewtopic.php?t=880
XXX.bas - http://chdk.setepontos.com/index.php/topic,1051.0.html

CHDKLover
« Last Edit: 04 / October / 2009, 11:14:03 by CHDKLover »

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Nested IF-Statement bug
« Reply #11 on: 04 / October / 2009, 11:28:19 »
Nice, that's helpful. I ran it on my CHDK script directory and found one: cyril42e's Focus Bracketing script from
http://crteknologies.free.fr/wiki/doku.php/photo:chdk-scripts.

Would it be hard to modify the patch to accept a spurious endif in a single line if statement?

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: Nested IF-Statement bug
« Reply #12 on: 04 / October / 2009, 14:49:12 »
Would it be hard to modify the patch to accept a spurious endif in a single line if statement?

This should be possible, but most of BASIC dialects use this rules for a clear distinction between singleline and multiline "if" statement.

We should faulty scripts no longer support. That would be the wrong way.

Rudi has created a very good patch and CHDKLover give us a cute little tool for a fast correction of affected scripts.

CHDK-DE:  CHDK-DE links

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: Nested IF-Statement bug
« Reply #13 on: 12 / October / 2009, 04:34:21 »
well if i dont see complaints here i will check in the patch during the next 7 days :)
Is this the same promise like this. ;)

I can not understand, why this patch is not applied. Many users in german chdk forum are waiting for this patch. There is a great script writer community.

It would be very nice when someone would check in this patch. Thank you.
CHDK-DE:  CHDK-DE links

Re: Nested IF-Statement bug
« Reply #14 on: 16 / October / 2009, 15:40:29 »
Hi,

Now yes, I would love to help "westoz". (http://chdk.setepontos.com/index.php/topic,4367.0/topicseen.html) and refer him to the attached  script. This script so far is running well.
But can I recommend the script, however, in good conscience? I do know that this nested IF error the user unknowingly mercilessly sits in the neck when he wants to change anything. 
And when he uses a additional IF statement, he gets a parse error indicated in last row. But there is nothing what he has done wrong.

List of unknwon Error.
When you delete "endif" or the simple "rem - line" you became Pars Err last row.

Line 102    if x>0 or y>0 then
               rem --- When you delete rem = Error !
               if t>0 or w>0 then
Line 77      if D>=24 then D=D-24 endif
Line 110      if (A-B)<0 then A=A+86400 endif
Line 115      if D>=24 then D=D-24 endif
Line 123      if D>=24 then D=D-24 endif
Line 134      if D>=24 then D=D-24 endif
Line 154      if D>=24 then D=D-24 endif
Line 182      if get_propset=1 then get_prop 205 T endif
Line 183      if get_propset=2 then get_prop 206 T endif
Line 206      if get_propset=1 then get_prop 205 T endif
Line 207      if get_propset=2 then get_prop 206 T endif

The script has parameters with german designations. That's not a problem. This script is running very well with the standard parameters.

So my question is, why the nested IF patch get no entry in CHDK?
Shall we let run new CHDK users now knowingly against the wall?

And ... please amends yet.

gehtnix

*

Offline reyalp

  • ******
  • 14125
Re: Nested IF-Statement bug
« Reply #15 on: 16 / October / 2009, 18:26:50 »
I agree this should be added. I haven't spent a lot of time with ubasic or the ubasic code, so I've been avoiding it so far, but if no one else does it soon I guess I will.

I do note that lua has a well specified syntax and has no problem with nested ifs ;)
Don't forget what the H stands for.

*

Offline fe50

  • ******
  • 3152
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: Nested IF-Statement bug
« Reply #16 on: 17 / October / 2009, 07:33:54 »
@gehtnix

Hello & welcome !
...nice to see you also here in the international forum, after > 1000 posts (and lots of great scripts) in the german forum...  8)

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Nested IF-Statement bug
« Reply #17 on: 18 / October / 2009, 22:00:26 »
sorry i really don't have much time for chdk right now, tho i'd really like to start coding and/or submitting code again. perhaps it's because i dont hang out in irc anymore i lost focus, dunno.

*

Offline an0n

  • ***
  • 152
Re: Nested IF-Statement bug
« Reply #18 on: 20 / October / 2009, 12:06:33 »
sorry i really don't have much time for chdk right now, tho i'd really like to start coding and/or submitting code again. perhaps it's because i dont hang out in irc anymore i lost focus, dunno.

No worries PhyrePhoX, many thanks for what you do here.
A720IS.

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Nested IF-Statement bug
« Reply #19 on: 24 / October / 2009, 06:34:46 »
I added a sticky (and locked) announcement about this upcoming fix here: http://chdk.setepontos.com/index.php/topic,4408.0.html .

Please proofread it so that we can put a link to it in the wikia main page.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal