Report Bugs Here

Moderator: Mmiscool

User avatar
By rodrigocirilo
#57978 Well come on, if I use the jscall "beep" with a simple button, interrupt or timer it works perfectly.

But when I use a code I'm testing it does not work.

Operation: I select the listbox number to serve as a parameter for the branch [abrir].
Then I select 1 in the listbox and click the (abrir) button it sends the character (A) through the serial and should call the "beep" through jscall, but nothing happens, it does not bip !!

Also if you enable a timer to call a branch that contains jscall "beep" nothing happens too !!

MMiscool could help me see what's happening !!

Code: Select allmemclear
io(po,5,0)
javascript beep.js
baudrate (1200)
valor = ""
login1 = read(end10)
senha1 = read(end11)
if login1 = "" then
goto [ver_senha]
print "sem login"
else
goto [ver_senha]
end if
wait
[ver_senha]
if senha1 = "" then
goto [grava]
print "sem senha"
delay 500
else
goto [inicio]
end if
wait

[grava]
serialprint ("@")
delay 500
io(po,5,0)
cls
Print "NOVO LOGIN: "
textbox login
print "NOVA SENHA: "
passwordbox senha
print "COMFIRME A SENHA: "
passwordbox senha2
button "GRAVAR",[val_senha]
wait

[val_senha]
if senha = senha2 then
write(end10,login)
write(end11,senha)
login = ""
senha = ""
goto [inicio]
else
print "Senhas nao conferem"
senha = ""
senha2 = ""
delay 1000
goto [grava]
end if
wait

[inicio]
cls
login1 = read(end10)
senha1 = read(end11)
print "LOGIN:   "
textbox  login
print "SENHA: "
passwordbox senha
button "Entrar",[tlogin]
wait

[tlogin]
if login = login1  then
GOTO [tsenha]
else
   
print "login invalido"
  delay 1000
   GOTO [inicio]
end if

[tsenha]
if senha = senha1 then
 cls
 GOTO [roda]
else 
 
print "senha invalida"
    delay 1000
   GOTO [inicio]
end if




[roda]

nome = read(endnomcli)

print (nome)
wprint "<br>"
wprint "<br>"
listbox selecao, "1,2,3,4,5,6,7,8,9,10,11,12", 12
wprint "<br>"
textbox porta1
wprint "<br>"
button "alterar Login/Senha", [grava]
wprint "<br>"
wprint "<br>"
button "ABRIR", [abrir]
wprint "<br>"
wprint "<br>"
button "SAIR",[TestExit]

serialbranch [change]
io(po,5,1)
delay 200
wait


[change]
bla = Serial.read.int()
if bla = 1 then
porta1 = "ABERTA"
bla = 0
'jscall "beep"   '  here, does not play
end if
if bla = 2 then
bla = 0
porta1 = "FECHADA"
end if
if bla = 3 then
porta2 = "ABERTA"
bla = 0
end if
if bla = 4 then
porta2 = "fechada"
bla = 0
end if
return

[abrir]
if selecao = "1" then
serialprint ("A")
jscall "beep"   'Or here, it also does not work
end if
if selecao = "2" then
serialprint ("B")
end if
if selecao = "3" then
serialprint ("C")
end if
if selecao = "4" then
serialprint ("D")
end if
if selecao = "5" then
serialprint ("E")
end if
if selecao = "6" then
serialprint ("F")
end if
if selecao = "7" then
serialprint ("G")
end if
if selecao = "8" then
serialprint ("H")
end if
if selecao = "9" then
serialprint ("I")
end if
if selecao = "10" then
serialprint ("J")
end if
if selecao = "11" then
serialprint ("K")
end if
if selecao = "12" then
serialprint ("L")
end if
wait


[TestExit]
serialprint ("@")
delay 500
io(po,5,0)
'senha = ""
cls
goto [inicio]