5

I am attempting to make a custom block according to the EV3 Block Developer kit (found here). I was able to create a simple block that returns the length of a string. This is what it looks like: simple program with custom blocks (The above program would correctly display a value of "2" on the screen.)

However, I am running into problems when I try to use the "string subset" block in the dev kit. The following program will not even compile (the text says "GOODBYE CRUEL WORLD"): broken program to read at index

I've hunted down the problem as residing in the "string subsection" block: Whenever this block is left out, the code will compile. Is this block not supported in EV3-G? LabView code




Edit: Here's the program along with the error: complete program with error

4
  • 1
    Interesting. I got the same result as you. I guess LEGO has missed to map this VI palette function to the corresponding brick primitive. I don't see a way to fix this. To learn that you can't use the full VI Palette for your own blocks is quite disappointing, I'm sure you are not the only one trying to enhance the existing function library. Especially string operations like find, split, etc. are really missing. I hope LEGO is going to fix this problem, since I really like the concept of EV3-G, but the possibility to enhance the function library will be quite essential.
    – alexs
    Commented Apr 16, 2015 at 14:00
  • Why do not you lay out your block?
    – bonny
    Commented Oct 19, 2017 at 7:46
  • These are custom VI blocks, not the custom blocks that you can lay out. I was looking for missing functionality that wasn't possible with the traditional "custom blocks".
    – Ernest3.14
    Commented Oct 19, 2017 at 11:56
  • Because I was trying to access functionality not baked into any existing blcoks. (Also I'm a C++ programmer by trade, so I like to do as much stuff at compile-time as possible.)
    – Ernest3.14
    Commented Oct 20, 2017 at 2:16

1 Answer 1

1

A temporary fix I found that works: using the provided "gray blobs", there is one named "PBRStringAtIndex" (or something like that) which will indeed compile (EV3 only). This does not address the similar "write at index" issue, and the output is a "byte" (presumably ASCII), not text.

(I will update this answer as I find out more.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.