Jump to content
IGNORED

Problem with def and NOT


Random Terrain

Recommended Posts

I started switching over to def in my latest program so it would be easier to read, but it doesn't work because of NOT. Here's an example that works:

 


  a{0} = !a{1}


loop

  drawscreen

  goto loop

 

 

Replace that with def and it won't work:

 


  def Test_00 = a{0}
  def Test_01 = a{1}
  def Test_02 = a{2}
  def Test_03 = a{3}
  def Test_04 = a{4}
  def Test_05 = a{5}
  def Test_06 = a{6}
  def Test_07 = a{7}


  Test_00 = !Test_01


loop

  drawscreen

  goto loop

 

 

I even switched to the latest version of bB posted here:

 

http://www.atariage.com/forums/topic/168036-new-build-improved-if-then/page__view__findpost__p__2081991

 

It didn't help. Did I discover a bug?

 

 

Thanks.

Link to comment
Share on other sites

The problem seems to be with spacing.

 

This doesn't work:

 


  def Test_00 = a{0}
  def Test_01 = a{1}
  def Test_02 = a{2}
  def Test_03 = a{3}
  def Test_04 = a{4}
  def Test_05 = a{5}
  def Test_06 = a{6}
  def Test_07 = a{7}


  Test_00 = !Test_01


loop

  drawscreen

  goto loop

But this does:


  def Test_00=a{0}
  def Test_01=a{1}
  def Test_02=a{2}
  def Test_03=a{3}
  def Test_04=a{4}
  def Test_05=a{5}
  def Test_06=a{6}
  def Test_07=a{7}


  Test_00 = !Test_01


loop

  drawscreen

  goto loop

bB is supposed to ignore extra spaces, but somehow they are not being ignored in defs.

  • Like 1
Link to comment
Share on other sites

bB is supposed to ignore extra spaces, but somehow they are not being ignored in defs.

At least there's an immediate solution. Thanks! I'll update the bB page.

 

 

 

 

I'd think it *should* work, so I'd say it's a bug. Here's a possible workaround:

 

  def Test_01 = a{1}
  def !Test_01 = !a{1}

I can't test it right now, but I think it might work.

It didn't work until the spaces were removed, but when the spaces are removed, it isn't needed anyway. Thanks.

Edited by Random Terrain
Link to comment
Share on other sites

Oddly enough, when I was making my first post I was wondering if the spaces around the "=" would confuse bB, because I seemed to recall a similar issue with "const", although I thought that was fixed for "const", so I went ahead and put spaces around the "=". :(

 

Michael

Edited by SeaGtGruff
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...