Author Topic: There's Always 1  (Read 170 times)

Robert

  • Hero Member
  • *****
  • Posts: 1119
    • View Profile
There's Always 1
« on: January 05, 2024, 07:40:45 PM »
BCX 8.0.8, in line 26663

Code: [Select]
        FPRINT FP_WRITE, "  iTmp += strlen(cp_p);"
the

Code: [Select]
strlen(cp_p)
always evaluates to 1.

Perhaps the computationally less expensive

Code: [Select]
        FPRINT FP_WRITE, "  iTmp ++;"
could be used.


MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1850
    • View Profile
Re: There's Always 1
« Reply #1 on: January 05, 2024, 09:31:54 PM »
Hi Robert ... 

If I add this:

Code: [Select]

FPRINT FP_WRITE,"printf(", ENC$("% zd\\n"), ",strlen(cp_p));"   ' Debug this!

Before this:

Code: [Select]

FPRINT FP_WRITE, "  iTmp += strlen(cp_p);"

and then rebuild BCX, strlen(cp_p) yields a lot more numbers than just the number 1.

What am I missing?


Robert

  • Hero Member
  • *****
  • Posts: 1119
    • View Profile
Re: There's Always 1
« Reply #2 on: January 05, 2024, 09:52:21 PM »
Hi Robert ... 

If I add this:

Code: [Select]

FPRINT FP_WRITE,"printf(", ENC$("% zd\\n"), ",strlen(cp_p));"   ' Debug this!

Before this:

Code: [Select]

FPRINT FP_WRITE, "  iTmp += strlen(cp_p);"

and then rebuild BCX, strlen(cp_p) yields a lot more numbers than just the number 1.

What am I missing?

I was checking the value of iTmp before and after

Code: [Select]

FPRINT FP_WRITE, "  iTmp += strlen(cp_p);"

The value after was always the value before +1.

It seems that there must be something there that I don't understand. Or maybe gremlins yanking my chain again just for kicks.

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1850
    • View Profile
Re: There's Always 1
« Reply #3 on: January 05, 2024, 10:41:23 PM »

... Or maybe gremlins yanking my chain again just for kicks.


The problem I have with Gremlins is that they're unreliable.