A Basic Interpreter written from scratch for the ESP8266

Moderator: Mmiscool

User avatar
By euclas@gmail.com
#66695 My code:

'
let tm = cdata & "/" & cmes & "/" & cano & chr(32) & chr(32) & chr(32) & chr(32) & chr(32) & cdia & " - " & left(descricao(nday),20) & & chr(32) & chr(32) & chr(32) & chr(32) & chr(32) & " " & chora & ":" & cminuto & ":" & csegundo & chr(13)
'
print tm
'

Appear:
Dia/Mes/Ano Dia da Semana Hora:Minuto:Segundo
01/01/00 1 - Sunday 00:03:18
01/01/00 1 - Sunday 00:03:19
01/01/00 1 - Sunday 00:03:20
01/01/00 1 - Sunday 00:03:21
01/01/00 1 - Sunday 00:03:21
01/01/00 1 - Sunday 00:03:22
01/01/00 1 - Sunday 00:03:23
01/01/00 1 - Sunday 00:03:23
01/01/00 1 - Sunday 00:03:24
01/01/00 1 - Sunday 00:03:25

I need:

Dia/Mes/Ano Dia da Semana Hora:Minuto:Segundo
01/01/00........1 - Sunday.............. 00:03:18
01/01/00........1 - Sunday.............. 00:03:19
01/01/00........1 - Sunday.............. 00:03:20
01/01/00........1 - Sunday.............. 00:03:21
01/01/00........1 - Sunday.............. 00:03:21
01/01/00........1 - Sunday.............. 00:03:22
01/01/00........1 - Sunday.............. 00:03:23
01/01/00........1 - Sunday.............. 00:03:23
01/01/00........1 - Sunday.............. 00:03:24
01/01/00........1 - Sunday.............. 00:03:25

* Points Placed where the spaces should appear

Error of who invented the HTML ??

The CHR(32)´s are ignored. I try & " " & and nothing changes.

In documentation there is no replicate function replicate(" ", nn) where "NN" is the number of times " " (Blank character) is repeated.

Example (possible):
'
let tm = cdata & "/" & cmes & "/" & cano & replicate(chr(32), 5) & cdia & " - " & left(descricao(nday),20) & replicate(chr(32), 20) & chora & ":" & cminuto & ":" & csegundo & chr(13)
'
print tm
'
I do not like and do not want to know about web notation (<BR> ...) for solving a problem that does not involve web

No one else needed to solve this worldwide?
I searched the forum here and found no solution

Some solution / suggestion????

Thank all.

Euclides (Brazil)
User avatar
By Mmiscool
#66701 if you use the unixtime() and specify the time in the unix time format and the format for the output you can get the result you want.

print unixtime(1496534899, "month /day . . .. . . . .. hour: min, - -- - - - -- sec, year, dow")

see the above example.

https://docs.google.com/document/d/1EiY ... 9te322o554
User avatar
By euclas@gmail.com
#66704 And what to do when the numbers that I want to show, are not dates or hours ??? Numbers are right-aligned ...
In the original Basic there was a format for presentation, which I believe, is so important that it would be worth creating:

http://www.antonis.de/qbebooks/gwbasman/printusing.html

Otherwise, would not it be interesting to think about creating a way to create functions? Thus, it would be possible to create specific functions for these situations.

Thank you.

Euclides (Brazil).