It is currently Mon May 22, 2017 2:28 pm



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: TIPS:Display "javascript console.log,syntax error" in "BASIC
Unread postPosted: Thu Mar 09, 2017 6:36 pm 
Offline

Joined: Wed Mar 05, 2014 1:15 am
Posts: 55
Hi all.

I found how to display "javascript console.log,syntax error" in "BASIC!".

I think it is useful.

Simply description:

1.Make HTML file. (include "javascript console.log,syntax error")
2.Open HTML in "BASIC! HTML-mode". (and Close)
3.Open "BASIC! system-mode".
4.Send OS command. (logcat)
5.Select necessary line from command execution result.(Include word "chromium")
6.Close "BASIC! system-mode".

Code is follows:
Code:
console.title "logcat"

! HTML MODE
html.open

html.load.url "jstest2.html"

pause 3000

html.close

pause 1000

PRINT "***logcat start***"

r$="logcat"

! os command mode
system.OPEN


! write the command
system.WRITE r$

! Give system time to respond
PAUSE 500

loop:

! check for a response
system.READ.READY ready

! if no input, do next command
IF !ready THEN GOTO loop

! read responses
DO
system.READ.LINE l$
!PRINT l$
if is_in("chromium",l$) > 0 then
   PRINT l$
endif
system.READ.READY ready
UNTIL !ready

pause 1000


PRINT "***logcat ended***"

console.save "logcat.txt"

end


Result sample is follows:
Quote:
***logcat start***
I/chromium(16964): [INFO:CONSOLE(177)] "basicjslog001test console", source: file:///storage/emulated/0/rfo-basic/data/jstest2.html (177)
I/chromium(16964): [INFO:CONSOLE(179)] "basicjslog002test console part2", source: file:///storage/emulated/0/rfo-basic/data/jstest2.html (179)
I/chromium(16964): [INFO:CONSOLE(182)] "basicjslog003test console err", source: file:///storage/emulated/0/rfo-basic/data/jstest2.html (182)
***logcat ended***


NOTE1:This sample is case of "console.log".
NOTE2:16964 is process ID.
NOTE3:177,179,182 is HTML line number.

I tested my Android 5.1 device(Colorfly G708).
Test result is OK.

How do you think about This Tips?

_________________
Sinagawa1

BASIC! beginner in Japan.

Sinagawa-ku, Tokyo Japan

URL:BASIC! Youtube video gallery(Japanese Langage Page)
http://www.geocities.jp/a_33/you/gallery.html
-------------------------


Top
 Profile  
 
 Post subject: Re: TIPS:Display "javascript console.log,syntax error" in "B
Unread postPosted: Fri Mar 10, 2017 12:52 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5518
Location: Paris, France
Very nice tip!
Does it also work on non-rooted phones?

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: TIPS:Display "javascript console.log,syntax error" in "B
Unread postPosted: Fri Mar 10, 2017 1:43 am 
Offline

Joined: Wed Mar 05, 2014 1:15 am
Posts: 55
mougino wrote:
Very nice tip!


Hi Nicolas.

Thank you for response.

mougino wrote:
Does it also work on non-rooted phones?


I tested two non-rooted android 5.1 tablet.
I did not used SU instructions.
It works fine.

_________________
Sinagawa1

BASIC! beginner in Japan.

Sinagawa-ku, Tokyo Japan

URL:BASIC! Youtube video gallery(Japanese Langage Page)
http://www.geocities.jp/a_33/you/gallery.html
-------------------------


Top
 Profile  
 
 Post subject: Re: TIPS:Display "javascript console.log,syntax error" in "B
Unread postPosted: Fri Mar 10, 2017 2:04 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5518
Location: Paris, France
Great ;) Maybe I'll add it as a new GW command then, if you don't mind of course!

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: TIPS:Display "javascript console.log,syntax error" in "B
Unread postPosted: Fri Mar 10, 2017 2:17 am 
Offline

Joined: Wed Mar 05, 2014 1:15 am
Posts: 55
mougino wrote:
Great ;) Maybe I'll add it as a new GW command then, if you don't mind of course!

Nicolas


Yes. I don't mind of course! :D

_________________
Sinagawa1

BASIC! beginner in Japan.

Sinagawa-ku, Tokyo Japan

URL:BASIC! Youtube video gallery(Japanese Langage Page)
http://www.geocities.jp/a_33/you/gallery.html
-------------------------


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
suspicion-preferred