BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code

Actually Ray.R version didn't work in 8.6 but doing Darin way did.

 

 

Regards
Ray Farmer
0 Kudos
Message 891 of 2,635
(12,274 Views)

Thanks Darin for fixing my Rube... 😄

 

I should have known better!

 

 

(what was I thinking????)

 

 

RayF,

 

That is strange...  Why would it not work in LV8.6?  Did you set the Search & Replace to "Regular Expression"?

0 Kudos
Message 892 of 2,635
(12,261 Views)

Ray.R,

 

Yep

 

 

Regards
Ray Farmer
0 Kudos
Message 893 of 2,635
(12,250 Views)

I have access to LV8.6, so I will try it.. Maybe a bug...??

0 Kudos
Message 894 of 2,635
(12,227 Views)

 


I have access to LV8.6, so I will try it.. Maybe a bug...??


 

A bug?!! That is what you call your devious code-obfuscation?  To the untrained eye it would appear that you are checking the offset past replacements which would be -1 in the case of no replacements.  No, I'll wager that the wire is actually connected to the Number of Replacements which is indeed zero when the search string is not found.  I don't even feel the need to boot LV to check my guess.

 

Rubes and obfuscation, throw a local variable or two in there why don't you?  Smiley Very Happy

 

 

Spoiler
Prepared to eat my hat if I am wrong, but I am never not wrong.

 

Message 895 of 2,635
(12,189 Views)

Darin, what would I do without you?? 😉

 

Glad that one of us is never wrong.  Sorry about the obfuscated code. 

 

I thought there was a bug in my code, not in LabVIEW 😄

Guess I was having a bad day   LOL!  😉

 

 

 

 

0 Kudos
Message 896 of 2,635
(12,180 Views)

 


@Ray.R wrote:

Darin, what would I do without you?? 😉

 

Glad that one of us is never wrong.  Sorry about the obfuscated code. 

 

I thought there was a bug in my code, not in LabVIEW 😄

Guess I was having a bad day   LOL!  😉

 

 

 

 


Nasty Darin!... Gosh, I'm glad I am never in error!

 

Smiley Sad

 

Spoiler
OK .... I sometimes make a mistake----

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 897 of 2,635
(12,164 Views)
If you post code to a thread designed for some hopefully good-natured mocking of others, it is hardly unreasonable to expect a little good-natured mocking in return....
Message 898 of 2,635
(12,160 Views)

that's what keeps this thread fun.

 

Just making sure you don't run out of supplies 😄

Message 899 of 2,635
(12,148 Views)

Can you spot the unecessary code complications on the left?

 

(seen here, this is only the tip of the iceberg! 🐵

 

 

 

  • We use a while loop as a FOR loop
  • With every itereation we create the entire ramp from scratch*, then index out one element
  • to get the wait time, we multiply it by 1000, then divide it by 1000 to get the original value.
  • We increment a counter in a shift register instead of using [i]
  • ....

 

On the right would be an equivalent code alternative... 😄

 

* Of course the loop invariant code handling on the compiler might sort some of the problems out, but still.....

 

0 Kudos
Message 900 of 2,635
(12,058 Views)