Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to append all log NOT only the last line of recived messages #10

Open
solyman opened this issue Feb 12, 2021 · 3 comments
Open

How to append all log NOT only the last line of recived messages #10

solyman opened this issue Feb 12, 2021 · 3 comments
Labels
question Further information is requested

Comments

@solyman
Copy link

solyman commented Feb 12, 2021

Hello! Andre Luis,

First of all I would like to thank you your extension. It's incredible.

second I am trying to send more than on command one after another & I try to collect all the received messages came from server (not only the last line) , but unfortunately I did not get it to work OK thought I try more than one scenario

here is the method I used in my project by appending to txt file then read that file , but the result was not correct

kindly I need your support to get all the revived output not only the last line

blocks

@aluis-rcastro
Copy link
Owner

It's a long time since I did this program, however if I'm not missing something, at a glance seems like you are likely not doing things the correct way. Opperations like "read" and "write" (to file) cannot be performed inline as such since are not done by callback functions. You should catch file events as "read done/write done" to trigger the corresponding read and write process.

@aluis-rcastro aluis-rcastro added the question Further information is requested label Feb 14, 2021
@solyman
Copy link
Author

solyman commented Feb 14, 2021

Hello! Andre Luis,

can I have more details (an example or something like that ) on how to get it work

Thank you inadvance

@aluis-rcastro
Copy link
Owner

Refer to the file "GotText" component, placed at the 2min57s on the folowing video:

How to Read File in MIT App Inventor 2 [ File Component ]

Note that you start reading with the "readFrom" method, but file content acquisition is effectively made upon "GotText" event. This happens because java processing time occurs much faster thatn peripherals timings, so a synchronization feature as such is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants