May 26, 2007

Programming Help!

Readers and Programmers,

The following is for NXT-G...

Is it possible to remove a letter or section from a phrase, like an opposite to the "Text" block? If so, how?

Also, is it possible to view all the files on the NXT? Again, if so, how?

Also, my computer crashes everytime I attempt to use a MyBlock. I can successfully create and edit a MyBlock, but if I attempt to drag it out onto the work area, the software crashes. This gets annoying being the type that overuses them. I can't stand the huge programs I'm forced to write now! The next thing I'm going to try is to create a new user and see what happens.

Ironically using NXT-G,
Robolab 2.9 (Richard)


Anonymous said...

In regard to your computer crashing because of My Blocks, there is a problem with My Blocks and text data. If you create a My Block with a data hub and wire in text data, that can cause NXT-G to crash. Not sure if this is your problem, however.

Andy said...

What is the MyBlocks supposed to do? E-mail me or get on MSN a bit more often so maybe I can help you!


Robolab 2.9 said...

Yes! That's my problem! Except, when that occured the first time, any MyBlock crashes the computer after that.

I have several MyBlocks that give me this problem.
InRange.rbt - keeps a number in range
WriteText.rbt - clears a certain spot on the screen and writes an inputed letter in that spot
ButtonInput.rbt - takes input from the NXT Buttons and add/subtract from a variable
WriteLetter.rbt - writes a certain letter depending on the value of the variable

I'll send 'em to you on MSN.


David Perdue said...

To stop NXT-G from crashing whenever you use any My Block, you may need to go in and manually remove the My Blocks you have created that use text data. If you enter a program, select "Edit --> Manage Custom Palette" from the menu bar. You can delete My Blocks from there.

This problem--My Blocks inability to accept text data--will probably be addressed with the 1.1 release of NXT-G in August.

Brian Davis said...

Others have addressed the issue of wiring text into MyBlocks being a current problem, but a couple of other points. First, that's a problem with the editor, not the compilier (I've compiled program using MyBlocks with text input, but is very difficult and tricky). Second, the idea of a block to produce substrings is a great one... one that has already been asked & answered by Jason King with his String Manipulation blocks:

As to viewing all the files, you can get very close from the NXT-G environment: open the NXT window, and when viewing the memory on the NXT brick look for a little check box near the upper right. Check it, and it will show you the normally "hidden" system and sound files.

Brian Davis

Robolab 2.9 said...


I guess I didn't get my point across. I meant how to view all the files on the NXT screen.


Brian Davis said...

Ah. You can't :-).

To refine that, I've yet to figure out a way to do so. For instance, there seems to be no way to view or BT-mail text files (.txt) to other NXT bricks, which is a real shame for some of the stuff I'm trying. Additionally, I've yet to find a way under NXT-G to interrogate the file system so a running program knows what's on the brick. There are tricks you can use to solve some of these issues, but they seem to be rooted in the FW (which drives the NXT menu system), not NXT-G (which simple runs on top of the on-the-brick FW).

Brian Davis

Robolab 2.9 said...

Ah, a pity.

Then what's this:


Brian Davis said...

That's a series of three programs, to demonstrate ways to open, read, write, and otherwise manipulate files on the NXT, from within a running NXT-G program. You can certainly use files from NXT-G (it's something I very commonly do, for a lot of things), but there are also file types on the NXT brick that are not normally exposed on the on-brick menu system (like .ric files, the ones that hold the image data, or .txt files, the text files created by the File Access blocks in NXT-G).

I'm beginning to suspect I still really don't understand the question.

Brian Davis

Robolab 2.9 said...

So, for example, I create a bunch of txt files with the file access block. Is it possible to see the names of them in a list?


Brian Davis said...

From within a running NXT-G program, if you know the name of a .txt file, you can access it with the File Access block. However, there is nothing like a "Catalog Access" block that returns a series of text strings that are the names of files on the NXT. If there is a limited list to choose form, you could try to read from a certain file... and if you got back a valid return, that file exists, while if you got back an error (there is an error output plug), that file doesn't exist.

Brian Davis

NXTBoy said...

Are there any languages for the NXT that do let you get a complete list of files?

I am trying to do a similar thing with .ric files in NXC

stud-brickmaster said...

Because NXTasy failed Jason King's Text Manipulation blocks are now avalible at:

Are there any help files for the blocks? I'm having a bit of troube with the Text Subset block.

Stud Brickmaster

Related Posts Plugin for WordPress, Blogger...